diff --git a/.github/workflows/merge-bot-pull-request.yml b/.github/workflows/merge-bot-pull-request.yml index ec0d06c..49170f5 100644 --- a/.github/workflows/merge-bot-pull-request.yml +++ b/.github/workflows/merge-bot-pull-request.yml @@ -6,8 +6,7 @@ on: pull_request_target: types: [opened, reopened, synchronize] -# Concurrency keys on the PR number rather than on github.ref, which under pull_request_target is the base branch and would serialize every bot PR against it, so each PR queues independently. -# The cancel-in-progress setting is false so a follow-up synchronize does not cancel an in-flight opened run before it enables auto-merge. +# GOVERNANCE.md "Workflow YAML Conventions" Concurrency exception (1). concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: false diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 1f3060f..c3e080f 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -25,10 +25,10 @@ on: - 'Directory.Packages.props' workflow_dispatch: -# The group is ref-independent so concurrent publishes serialize. -# The cancel-in-progress setting is false so a publish is never cancelled mid-release, which would leave a half-created GitHub release or a partial NuGet push. +# GOVERNANCE.md "Workflow YAML Conventions" Concurrency exception (2). +# The expression must track publish-plan-task.yml's push rule and actor allowlist. concurrency: - group: ${{ github.workflow }} + group: ${{ github.workflow }}-${{ github.ref }}${{ github.event_name == 'push' && (github.ref != 'refs/heads/main' || (github.actor != 'ptr727-codegen[bot]' && github.actor != 'dependabot[bot]')) && format('-{0}', github.run_id) || '' }} cancel-in-progress: false # GITHUB_TOKEN gets no scope by default, and each job below grants only what it writes with. diff --git a/.github/workflows/run-periodic-codegen-pull-request.yml b/.github/workflows/run-periodic-codegen-pull-request.yml index e36f2ea..bbe392d 100644 --- a/.github/workflows/run-periodic-codegen-pull-request.yml +++ b/.github/workflows/run-periodic-codegen-pull-request.yml @@ -10,8 +10,7 @@ on: schedule: - cron: '0 4 * * *' -# Workflow-only group, with no github.ref, because the task writes to the fixed codegen-main and codegen-develop branches regardless of the triggering ref. -# A dispatch and the scheduled run must therefore not race on them. +# GOVERNANCE.md "Workflow YAML Conventions" Concurrency exception (5). concurrency: group: ${{ github.workflow }} cancel-in-progress: true diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index 22833ae..ea52596 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -92,9 +92,10 @@ jobs: # Single required status check. # Its name is the ruleset-bound context, so do not rename it without updating the ruleset in lockstep. + # A push or dispatch run takes another name, so only the pull request's own run can post that context on its head. # It treats a skipped smoke build, meaning an unchanged target, as a pass, and blocks on failure or cancelled (D1.5, D7.4). check-workflow-status: - name: Check pull request workflow status job + name: ${{ github.event_name == 'pull_request' && 'Check pull request workflow status job' || 'Check workflow status job' }} runs-on: ubuntu-latest needs: [changes, validate, smoke-build] if: always()