Skip to content

Commit

Permalink
Add support for including/excluding list of files to check for uncomm…
Browse files Browse the repository at this point in the history
…ited changes (#4)

Add support for including/excluding list of files to check for uncommitted changes
  • Loading branch information
zupo authored Nov 4, 2023
1 parent 14e0713 commit a5e857a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,19 @@ This GitHub Action checks if there are uncommited or not ignored files present a
- name: Check for uncommitted-changes
uses: teamniteo/gha-actions/uncommitted-changes@main
```

You can exclude some files like so:

```yaml
with:
files: "!graphs/*.png"
```

Or multiple files likes:

```
with:
files: |
!graphs/*.png
!mockups/*.bmpr
```
8 changes: 7 additions & 1 deletion uncommitted-changes/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ name: "Uncommitted Changes"
description:
Fail if any uncommitted changes are detected.

inputs:
files:
default:

runs:
using: "composite"
steps:
- uses: tj-actions/verify-changed-files@v14
id: verify-changed-files
with:
files: ${{ inputs.files }}

- name: List all changed files tracked and untracked files
if: steps.verify-changed-files.outputs.files_changed == 'true'
shell: bash
run: |
echo "::error title=🔴 Changed files:: ${{ steps.verify-changed-files.outputs.changed_files }}"
git diff
exit 1
exit 1

0 comments on commit a5e857a

Please sign in to comment.