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:
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user