Skip to content

Commit

Permalink
chore: test detecting deleted unstaged files (#340)
Browse files Browse the repository at this point in the history
* chore: test detecting deleted unstaged files

* Update test.yml

* Update test.yml

* Update test.yml

* Update entrypoint.sh

* Update action.yml

* Update entrypoint.sh

* Update action.yml
  • Loading branch information
jackton1 committed Oct 1, 2023
1 parent fe1db7a commit 54e20d3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,26 @@ jobs:
run: |
echo "No Changes found: (Not expected)"
exit 1
- name: Delete test/new.txt without staging
run: |
rm test/new.txt
- name: Test deletion of test/new.txt
uses: ./
id: deleted_file_test

- name: Show output
run: |
echo "Changed files: ${{ steps.deleted_file_test.outputs.changed_files }}"
- name: Display deleted file test result
if: "contains(steps.deleted_file_test.outputs.changed_files, 'test/new.txt')"
run: |
echo "Deletion detected: ${{ steps.deleted_file_test.outputs.changed_files }}"
- name: Verify Deletion of test/new.txt
if: "!contains(steps.deleted_file_test.outputs.changed_files, 'test/new.txt')"
run: |
echo "No Deletion detected: (Not expected)"
exit 1
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ runs:
steps:
- name: Glob match
uses: tj-actions/glob@v17
if: inputs.files != ''
id: glob
with:
files: ${{ inputs.files }}
Expand Down

0 comments on commit 54e20d3

Please sign in to comment.