From 18a842ea53be1ef117658ecc31970a845b2b05f0 Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Thu, 17 Oct 2024 10:23:31 +1100 Subject: [PATCH] ci: Use a PAT with tag-new in order to trigger the release workflow. --- .github/workflows/release.yml | 9 +-------- .github/workflows/tag-new-release.yml | 3 ++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d68e1ad0..9a109bfb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,11 +5,6 @@ on: pull_request: merge_group: push: # testing, unless there's a tag (steps.0.if below) - workflow_run: - workflows: ["tag new release"] - types: - - completed - env: REGISTRY: ghcr.io @@ -27,14 +22,12 @@ jobs: outputs: binary_hashes: ${{ steps.binary.outputs.hashes }} image_subjects: ${{ steps.image.outputs.subjects }} - # https://github.com/orgs/community/discussions/26238 - if: ${{ !github.event.workflow_run || github.event.workflow_run.conclusion == 'success' }} steps: - name: print github context env: GITHUB_CONTEXT: ${{ toJSON(github) }} run: echo $GITHUB_CONTEXT - - if: ${{ !startsWith(github.ref, 'refs/tags/') && !github.event.workflow_run }} + - if: ${{ !startsWith(github.ref, 'refs/tags/') }} run: echo "flags=--snapshot" >> $GITHUB_ENV - uses: actions/checkout@v4 with: diff --git a/.github/workflows/tag-new-release.yml b/.github/workflows/tag-new-release.yml index 8690e943..6a302488 100644 --- a/.github/workflows/tag-new-release.yml +++ b/.github/workflows/tag-new-release.yml @@ -15,7 +15,8 @@ jobs: - uses: mathieudutour/github-tag-action@v6.2 continue-on-error: true # ok to not make a new tag with: - github_token: ${{ secrets.GITHUB_TOKEN }} + # Special PAT so that we trigger new workflows + github_token: ${{ secrets.TAG_TOKEN }} create_annotated_tag: true custom_release_rules: ci:none,chore:none,style:none dry_run: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'schedule' }}