Skip to content

Commit 9b64d15

Browse files
committed
ci: require stable releases from main
1 parent 1090331 commit 9b64d15

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
stable: ${{ steps.version.outputs.stable }}
2121
steps:
2222
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
23+
with:
24+
fetch-depth: 0
2325

2426
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
2527
with:
@@ -38,6 +40,11 @@ jobs:
3840
3941
if [[ "$package_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
4042
echo "stable=true" >> "$GITHUB_OUTPUT"
43+
release_commit="$(git rev-parse "${RELEASE_TAG}^{commit}")"
44+
if ! git merge-base --is-ancestor "$release_commit" origin/main; then
45+
echo "Stable release $RELEASE_TAG must point to a commit contained in main." >&2
46+
exit 1
47+
fi
4148
else
4249
echo "stable=false" >> "$GITHUB_OUTPUT"
4350
fi

0 commit comments

Comments
 (0)