Add step id explanation for output in README.md (#324)

This commit is contained in:
Christian Vermeulen 2024-03-15 16:06:58 +01:00 committed by GitHub
parent e040c596f0
commit 9b5e5ee10a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -167,9 +167,16 @@ You can use these outputs to trigger other Actions in your Workflow run based on
- `changes_detected`: Returns either "true" or "false" if the repository was dirty and files have changed. - `changes_detected`: Returns either "true" or "false" if the repository was dirty and files have changed.
- `commit_hash`: Returns the full hash of the commit if one was created. - `commit_hash`: Returns the full hash of the commit if one was created.
**⚠️ When using outputs, the step needs to be given an id. See example below.**
### Example ### Example
```yaml ```yaml
- uses: stefanzweifel/git-auto-commit-action@v5
id: auto-commit-action #mandatory for the output to show up in ${{ steps }}
with:
commit_message: Apply php-cs-fixer changes
- name: "Run if changes have been detected" - name: "Run if changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'true' if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "Changes!" run: echo "Changes!"