diff --git a/.gitea/workflows/build_and_puplish.yml b/.gitea/workflows/build_and_puplish.yml index 84486bf..9f294b4 100644 --- a/.gitea/workflows/build_and_puplish.yml +++ b/.gitea/workflows/build_and_puplish.yml @@ -32,8 +32,10 @@ jobs: git config user.name "${{ vars.USERNAME_GIT }}" git config user.email "${{ vars.EMAIL_GIT }}" git add package.json - git commit -m "Update version to ${{ github.ref_name }}" - git push origin HEAD:${GITHUB_HEAD_REF:-$(git rev-parse --abbrev-ref HEAD)} + 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/} + git push origin HEAD:refs/heads/$BRANCH - name: Publish to Visual Studio Marketplace (Pre-Release) if: ${{ github.event.release.prerelease }} run: vsce publish --pre-release