update pipline
/ build_and_publish (release) Successful in 28s

This commit is contained in:
Christoph Brandau
2025-08-11 17:19:47 +02:00
parent 9d5ef23162
commit ef558c3aa3
+17 -2
View File
@@ -36,8 +36,23 @@ jobs:
git config user.email "${{ vars.EMAIL_GIT }}"
git add package.json
git commit -m "Update version to ${{ github.ref_name }}" || echo "No changes to commit."
BRANCH=$(git for-each-ref --format='%(refname:short)' --contains HEAD refs/remotes/origin | head -n1)
BRANCH=${BRANCH#origin/}
# Get current branch; if detached, resolve to a remote branch that contains this commit
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [[ "$BRANCH" == "HEAD" || -z "$BRANCH" ]]; then
# If target_commitish is a branch, use it; if its a SHA, find a branch that contains it
CANDIDATE='${{ github.event.release.target_commitish }}'
if [[ "$CANDIDATE" =~ ^[0-9a-f]{40}$ ]]; then
BRANCH="$(git branch -r --contains "$GITHUB_SHA" | sed -n 's|.*origin/||p' | head -n1)"
else
BRANCH="$CANDIDATE"
fi
fi
if [[ -z "$BRANCH" ]]; then
echo "Could not determine branch for push."; git branch -a; exit 1
fi
git push origin HEAD:refs/heads/$BRANCH
- name: Publish to Visual Studio Marketplace (Pre-Release)
if: ${{ github.event.release.prerelease }}