From b68bb072d96c8799ef0aebd37dcf3dc12b1af719 Mon Sep 17 00:00:00 2001 From: dangershony Date: Mon, 22 Jul 2024 20:40:02 +0100 Subject: [PATCH] try to only trigger the tag creation when all the hobs have completed --- .github/workflows/build.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 370eae36..62408184 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,7 @@ jobs: with: dotnet-version: | 8.0.x + - name: Setup Node.js (${{ matrix.node_version }}) uses: actions/setup-node@v1 with: @@ -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 \ No newline at end of file + git push https://x-access-token:${{ secrets.ANGOR_DEPLOY_TOKEN }}@github.com/${{ github.repository }} $TAG_NAME