Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Allan Lei <[email protected]>
  • Loading branch information
allanlei authored Jan 10, 2024
1 parent f949319 commit 2ed2f43
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
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
```

0 comments on commit 2ed2f43

Please sign in to comment.