Only create releases for tags pointing at master
build-apk / build (push) Canceled after 4m12s

Guard the Create Gitea release step: fetch origin/master and compare with
the tagged commit; if the tag is not on master's tip, skip release creation
instead of publishing a release for a feature/dev branch.
This commit is contained in:
2026-08-12 00:53:22 +03:00
parent 4e18000773
commit 6f7ae57dd7
+7
View File
@@ -94,6 +94,13 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: |
set -eux
# Releases only for tags that point at the master branch tip —
# a tag pushed to a feature/dev branch never creates a release.
git fetch origin master
if [ "$(git rev-parse HEAD)" != "$(git rev-parse FETCH_HEAD)" ]; then
echo "Tag ${GITHUB_REF_NAME} does not point to master — skipping release creation"
exit 0
fi
TAG=${GITHUB_REF_NAME}
API="${{ github.api_url }}/repos/${GITHUB_REPOSITORY}"
REL=$(curl -s -X POST "$API/releases" \