diff --git a/.github/workflows/image+upload.yaml b/.github/workflows/image+upload.yaml index ce51ed4d3..ea3234cd1 100644 --- a/.github/workflows/image+upload.yaml +++ b/.github/workflows/image+upload.yaml @@ -128,7 +128,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@master + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Determine the current branch + id: determine_branch + run: | + branch=$(git branch -r --contains $GITHUB_SHA | grep -v '\->' | grep -E 'origin/(main|master|develop|feature|fix)' | head -n 1 | sed 's|origin/||') + echo "branch=$branch" >> $GITHUB_ENV + echo "Determined branch: $branch" - name: update package.json version if: needs.prepare.outputs.version @@ -145,7 +154,7 @@ jobs: git config --global user.email 'github-actions@github.com' git add package.json git commit -m "chore: update package.json version to ${{ needs.prepare.outputs.version }}" - git push + git push origin HEAD:${{ env.branch }} post-slack-tag-update-success: name: Post slack message for tag update success