diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cbccfd84a4d6..c7de5a46ce01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,5 +46,7 @@ jobs: sync: if: ${{ github.ref != 'refs/heads/main' }} uses: ./.github/workflows/sync_branches.yml + with: + enabled: ${{ secrets.MIXXX_BRANCH_SYNC_PAT != '' }} secrets: MIXXX_BRANCH_SYNC_PAT: ${{ secrets.MIXXX_BRANCH_SYNC_PAT }} diff --git a/.github/workflows/sync_branches.yml b/.github/workflows/sync_branches.yml index d6d47ab572a7..3a1f3b23e101 100644 --- a/.github/workflows/sync_branches.yml +++ b/.github/workflows/sync_branches.yml @@ -2,6 +2,14 @@ name: Sync Branches on: workflow_call: + inputs: + enabled: + type: boolean + default: true + description: >- + Whether or not to run this workflow. This is a workaround on the 'secrets' context not being + available in 'jobs..if' + (https://docs.github.com/en/actions/reference/accessing-contextual-information-about-workflow-runs#context-availability) secrets: # PAT setup with content:write and pull_request:write MIXXX_BRANCH_SYNC_PAT: @@ -21,7 +29,7 @@ env: jobs: sync-branches: - if: ${{ inputs.pat_token != '' }} + if: ${{ inputs.enabled }} runs-on: ubuntu-latest permissions: contents: write