From 6f7ae57dd75e5eee051269133eb71e3ccc6d7dea Mon Sep 17 00:00:00 2001 From: Sanders Date: Wed, 12 Aug 2026 00:53:22 +0300 Subject: [PATCH] Only create releases for tags pointing at master 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. --- .gitea/workflows/build-apk.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitea/workflows/build-apk.yml b/.gitea/workflows/build-apk.yml index a643b39..479c71d 100644 --- a/.gitea/workflows/build-apk.yml +++ b/.gitea/workflows/build-apk.yml @@ -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" \