Skip to content

Commit ff2341a

Browse files
committed
docs: add outputs section documenting triggered output
- Add outputs table showing triggered output description - Include practical example showing how to use the triggered output - Follow format from action-builder-ghcr for consistency - Enables downstream actions to conditionally run based on trigger status
1 parent 1553ed7 commit ff2341a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,34 @@ jobs:
184184
branch: main
185185
```
186186

187+
# Outputs
188+
189+
| Output | Description |
190+
| --------- | ------------------------------------------ |
191+
| triggered | Whether the action was triggered based on path changes (true/false) |
192+
193+
Has the action been triggered by path changes? \[true|false\]
194+
195+
```yaml
196+
- id: test
197+
uses: bcgov/action-test-and-analyse@main
198+
with:
199+
commands: |
200+
npm ci
201+
npm run test:cov
202+
dir: frontend
203+
node_version: "20"
204+
triggers: ('frontend/')
205+
206+
- name: Check if tests were triggered
207+
run: |
208+
if [ "${{ steps.test.outputs.triggered }}" = "true" ]; then
209+
echo "✅ Tests were triggered by path changes"
210+
else
211+
echo "ℹ️ Tests were not triggered (no matching path changes)"
212+
fi
213+
```
214+
187215
# Sonar Project Token
188216

189217
SonarCloud project tokens are free, available from [SonarCloud] or your organization's aministrators.

0 commit comments

Comments
 (0)