Skip to content

Commit d7c5f7e

Browse files
committed
Avoid temporary release tag collisions
1 parent 22a471c commit d7c5f7e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎.github/workflows/publish-javadoc.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
exit 0
3939
fi
4040
41-
git fetch --no-tags origin "refs/tags/${TAG_NAME}:refs/tags/release"
42-
tag_commit="$(git rev-parse --verify 'refs/tags/release^{commit}')"
41+
git fetch --no-tags origin "refs/tags/${TAG_NAME}"
42+
tag_commit="$(git rev-parse --verify 'FETCH_HEAD^{commit}')"
4343
if git merge-base --is-ancestor "$tag_commit" origin/main; then
4444
echo "eligible=true" >> "$GITHUB_OUTPUT"
4545
echo "commit=$tag_commit" >> "$GITHUB_OUTPUT"

‎SimpleAPI/src/test/java/com/bencodez/simpleapi/build/BuildInputPinningTest.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ void documentationUsesVerifiedReleaseCommitAndAggregateOutput() throws IOExcepti
2323
assertTrue(workflow.contains("types: [published, released]"));
2424
assertTrue(verificationJob.contains("git merge-base --is-ancestor \"$tag_commit\" origin/main"));
2525
assertFalse(workflow.contains("target_commitish"));
26+
assertTrue(verificationJob.contains("FETCH_HEAD^{commit}"));
27+
assertFalse(verificationJob.contains("refs/tags/release"));
2628
assertTrue(buildJob.contains("ref: ${{ needs.verify-release.outputs.commit }}"));
2729
assertTrue(buildJob.contains("path: SimpleAPI/target/reports/apidocs"));
2830
assertTrue(deployJob.contains("needs.build.result == 'success'"));

0 commit comments

Comments
 (0)