Skip to content

Commit 65b61bb

Browse files
committed
fix: Don’t check for file existence immediately after deleting it
1 parent 8deb303 commit 65b61bb

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

.github/actions/gh-cache/delete/action.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,13 @@ runs:
7373
shell: bash
7474
working-directory: .gh-cache-${{ github.run_id }}
7575
run: |
76-
if [ -f "${{ inputs.path }}" ]; then
77-
git add "${{ inputs.path }}"
78-
git config user.name "github-actions[bot]"
79-
git config user.email "github-actions[bot]@users.noreply.github.com"
80-
git commit -m "$(printf 'Delete artifact: %s' "${{ inputs.path }}")" \
81-
&& echo "Committed '${{ inputs.path }}' to 'gh-cache' branch" \
82-
|| echo "No changes to commit"
83-
git push origin gh-cache
84-
else
85-
echo "'${{ inputs.path }}' does not exist"
86-
echo "Skipping commit and push"
87-
fi
76+
git add "${{ inputs.path }}" || true
77+
git config user.name "github-actions[bot]"
78+
git config user.email "github-actions[bot]@users.noreply.github.com"
79+
git commit -m "$(printf 'Delete artifact: %s' "${{ inputs.path }}")" \
80+
&& echo "Committed '${{ inputs.path }}' to 'gh-cache' branch" \
81+
|| echo "No changes to commit"
82+
git push origin gh-cache
8883
8984
- name: Clean up temporary directory
9085
shell: bash

0 commit comments

Comments
 (0)