Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
IonBazan authored Nov 2, 2022
1 parent d785cb8 commit d6157c5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,18 @@ steps:
diff: ${{ steps.composer_diff.outputs.composer_diff }}
```

## Usage with push or schedule triggered workflows

This action is intended to be used with Pull Requests, hence `base` defaults to `${{ github.event.pull_request.base.sha }} ` which produces an empty string for runs triggered without a PR. This may cause issues when running it in a workflow triggered with a push or cron, producing an empty diff as `composer-diff` will use same file for base and head (see https://github.com/IonBazan/composer-diff-action/issues/9).

To prevent this from happening, set `base` parameter to `HEAD` (or any other git reference):

```yml
- name: Generate composer diff
id: composer_diff # To reference the output in comment
uses: IonBazan/composer-diff-action@v1
with:
base: HEAD
no-dev: true
format: mdlist
```

0 comments on commit d6157c5

Please sign in to comment.