Skip to content

Commit d6157c5

Browse files
authored
Update README.md
1 parent d785cb8 commit d6157c5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,18 @@ steps:
8888
diff: ${{ steps.composer_diff.outputs.composer_diff }}
8989
```
9090

91+
## Usage with push or schedule triggered workflows
92+
93+
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).
94+
95+
To prevent this from happening, set `base` parameter to `HEAD` (or any other git reference):
96+
97+
```yml
98+
- name: Generate composer diff
99+
id: composer_diff # To reference the output in comment
100+
uses: IonBazan/composer-diff-action@v1
101+
with:
102+
base: HEAD
103+
no-dev: true
104+
format: mdlist
105+
```

0 commit comments

Comments
 (0)