From 54e20d3c522fbeed99ebaf2e38a1eb33214c58ba Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 30 Sep 2023 20:35:32 -0600 Subject: [PATCH] chore: test detecting deleted unstaged files (#340) * 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 --- .github/workflows/test.yml | 23 +++++++++++++++++++++++ action.yml | 1 + 2 files changed, 24 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f96bd14..3acf517 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/action.yml b/action.yml index 1577e01..d4ff418 100644 --- a/action.yml +++ b/action.yml @@ -39,6 +39,7 @@ runs: steps: - name: Glob match uses: tj-actions/glob@v17 + if: inputs.files != '' id: glob with: files: ${{ inputs.files }}