Skip to content

Commit 6bebc02

Browse files
fix(ci): add fallback for GitHub API failures in release workflow (#388)
## Description CI was failing on new module releases because there was no fallback to gh api failures when there was no previous tag for the module was found. https://github.com/coder/registry/actions/runs/17225186737/job/48868318539 <!-- Briefly describe what this PR does and why --> ## Type of Change - [ ] New module - [ ] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [X] Other
1 parent 97b036e commit 6bebc02

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,15 @@ jobs:
7373
exit 0
7474
fi
7575
76-
FULL_CHANGELOG=$(gh api repos/:owner/:repo/releases/generate-notes \
77-
--field tag_name="$CURRENT_TAG" \
78-
--field previous_tag_name="$PREV_TAG" \
79-
--jq '.body')
76+
if [[ "$PREV_TAG" == release/* ]]; then
77+
FULL_CHANGELOG=$(gh api repos/:owner/:repo/releases/generate-notes \
78+
--field tag_name="$CURRENT_TAG" \
79+
--field previous_tag_name="$PREV_TAG" \
80+
--jq '.body')
81+
else
82+
echo "New module detected, skipping GitHub API"
83+
FULL_CHANGELOG=""
84+
fi
8085
8186
MODULE_COMMIT_SHAS=$(git log --format="%H" --no-merges "$PREV_TAG..$CURRENT_TAG" -- "$MODULE_PATH")
8287

0 commit comments

Comments
 (0)