Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- `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

```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"
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "Changes!"
Expand Down