Skip to content

Commit 971a116

Browse files
kim-emclaude
andcommitted
fix: verify release artifacts exist before creating release
Add a check that artifacts were downloaded successfully before attempting to create the release. This is equivalent to the `fail_on_unmatched_files: true` option in the old `softprops/action-gh-release` action. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e4511b0 commit 971a116

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/pr-release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,22 @@ jobs:
7272
gh release delete --repo ${{ github.repository_owner }}/lean4-pr-releases pr-release-${{ steps.workflow-info.outputs.pullRequestNumber }}-${{ env.SHORT_SHA }} -y || true
7373
env:
7474
GH_TOKEN: ${{ secrets.PR_RELEASES_TOKEN }}
75+
# Verify artifacts were downloaded (equivalent to fail_on_unmatched_files in the old action).
76+
- name: Verify release artifacts exist
77+
if: ${{ steps.workflow-info.outputs.pullRequestNumber != '' }}
78+
run: |
79+
shopt -s nullglob
80+
files=(artifacts/*/*)
81+
if [ ${#files[@]} -eq 0 ]; then
82+
echo "::error::No artifacts found matching artifacts/*/*"
83+
exit 1
84+
fi
85+
echo "Found ${#files[@]} artifacts to upload:"
86+
printf '%s\n' "${files[@]}"
7587
# We use `gh release create` instead of `softprops/action-gh-release` because
7688
# the latter enumerates all releases to check for existing ones, which fails
7789
# when the repository has more than 10000 releases (GitHub API pagination limit).
90+
# Upstream fix: https://github.com/softprops/action-gh-release/pull/725
7891
- name: Release (short format)
7992
if: ${{ steps.workflow-info.outputs.pullRequestNumber != '' }}
8093
run: |

0 commit comments

Comments
 (0)