-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Allan Lei <[email protected]>
- Loading branch information
Showing
1 changed file
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
# action-git-diff | ||
# action-git-diff | ||
|
||
## Usage | ||
|
||
## Inputs 📥 | ||
|
||
| Input | Required? | Default | Description | | ||
| ----- | --------- | ------- | ----------- | | ||
| `head-ref` | no | `HEAD` | head ref to use for the git diff | | ||
| `base-ref` | no | `HEAD~1` | base ref to use for the git diff | | ||
| `default-branch` | no | `${{ github.ref_name }}` | Branch to use when `HEAD` is referenced | | ||
| `status` | no | `d` | Change status of the files to filter by. See https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203 | | ||
| `filename-pattern` | no | `**/*` | Filename globs to filter by | | ||
| `token` | no | `.` | Github token to use | | ||
|
||
## Outputs 📤 | ||
|
||
| Output | Description | | ||
| ------ | ----------- | | ||
| `filenames` | List of changed filenames in JSON format | | ||
| `json` | Raw data of the comparison in JSON | | ||
|
||
### Example | ||
|
||
#### Using the action for Pushes / PRs | ||
``` | ||
steps: | ||
- name: Generate Changed Filenames | ||
uses: swaglive/action-git-diff@main | ||
with: | ||
head-ref: ${{ github.event.pull_request.head.sha || github.event.after || 'HEAD' }} | ||
base-ref: ${{ github.event.pull_request.base.sha || github.event.before || 'HEAD~1' }} | ||
filename-pattern: |- | ||
**/*.js | ||
``` |