Skip to content

Commit daa31db

Browse files
committed
fix(ci): gate release PR creation on existing baseline tag
Skip release-please PR generation when the manifest baseline tag is missing so release races cannot backfill old commits into the next release PR. Made-with: Cursor
1 parent ed1edb8 commit daa31db

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,26 @@ jobs:
2828
release-please:
2929
runs-on: ubuntu-latest
3030
steps:
31+
- uses: actions/checkout@v5
32+
with:
33+
fetch-depth: 1
34+
35+
- id: gate
36+
shell: bash
37+
run: |
38+
set -euo pipefail
39+
manifest_version="$(jq -r '.["."]' .release-please-manifest.json)"
40+
tag="v${manifest_version}"
41+
if git ls-remote --tags "https://github.com/${GITHUB_REPOSITORY}.git" "refs/tags/${tag}" | rg -q .; then
42+
echo "skip=false" >> "$GITHUB_OUTPUT"
43+
echo "Release baseline tag ${tag} exists; proceeding."
44+
else
45+
echo "skip=true" >> "$GITHUB_OUTPUT"
46+
echo "Release baseline tag ${tag} is missing; skipping PR generation to avoid changelog backfill."
47+
fi
48+
3149
- uses: googleapis/release-please-action@v4
50+
if: steps.gate.outputs.skip != 'true'
3251
with:
3352
config-file: release-please-config.json
3453
manifest-file: .release-please-manifest.json

0 commit comments

Comments
 (0)