Skip to content

Commit 9466304

Browse files
committed
fix: Only output a file that exists
1 parent 9316e43 commit 9466304

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ runs:
3535
run: |
3636
mkdir -p "$(dirname "${{ inputs.key }}")"
3737
echo '${{ inputs.value }}' > "${{ inputs.key }}"
38-
- name: Save cached value
38+
- if: ${{ inputs.value }}
39+
name: Save cached value
3940
uses: github/continuous-accessibility-scanner/.github/actions/gh-cache/save@smockle/cache-findings
4041
with:
4142
path: ${{ inputs.key }}
@@ -44,7 +45,9 @@ runs:
4445
shell: bash
4546
run: |
4647
echo "value<<EOF" >> $GITHUB_OUTPUT
47-
cat "${{ inputs.key }}" >> $GITHUB_OUTPUT
48+
if [ -f "${{ inputs.key }}" ]; then
49+
cat "${{ inputs.key }}" >> $GITHUB_OUTPUT
50+
fi
4851
echo "EOF" >> $GITHUB_OUTPUT
4952
5053
branding:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ runs:
3333
- name: Copy file to repo
3434
shell: bash
3535
run: |
36-
if [ -e "${{ inputs.path }}" ]; then
36+
if [ -f "${{ inputs.path }}" ]; then
3737
cp -Rf "${{ inputs.path }}" ".gh-cache-${{ github.run_id }}/${{ inputs.path }}"
3838
fi
3939
4040
- name: Commit and push
4141
shell: bash
4242
working-directory: .gh-cache-${{ github.run_id }}
4343
run: |
44-
if [ -e "${{ inputs.path }}" ]; then
44+
if [ -f "${{ inputs.path }}" ]; then
4545
git add "${{ inputs.path }}"
4646
git config user.name "github-actions[bot]"
4747
git config user.email "github-actions[bot]@users.noreply.github.com"

0 commit comments

Comments
 (0)