Skip to content

Commit

Permalink
try to only trigger the tag creation when all the hobs have completed
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony committed Jul 22, 2024
1 parent 5f236d3 commit b68bb07
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
with:
dotnet-version: |
8.0.x
- name: Setup Node.js (${{ matrix.node_version }})
uses: actions/setup-node@v1
with:
Expand Down Expand Up @@ -72,13 +73,23 @@ jobs:
echo "::set-output name=changed::false"
fi
# we must use a custom token to trigger workflows ANGOR_DEPLOY_TOKEN
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow
finalize:
runs-on: ubuntu-latest
needs: build
if: needs.build.outputs['check_changes.outputs.changed'] == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup git
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Create tag
if: steps.check_changes.outputs.changed == 'true'
env:
TAG_NAME: "v${{env.VERSION}}"
TAG_NAME: "v${{ needs.build.outputs['check_changes.outputs.changed'] }}"
run: |
sleep 10
git tag $TAG_NAME
git push https://x-access-token:${{ secrets.ANGOR_DEPLOY_TOKEN }}@github.com/${{ github.repository }} $TAG_NAME
git push https://x-access-token:${{ secrets.ANGOR_DEPLOY_TOKEN }}@github.com/${{ github.repository }} $TAG_NAME

0 comments on commit b68bb07

Please sign in to comment.