From 82f8400286d3ad6ed404e9b467674ee8011439c8 Mon Sep 17 00:00:00 2001 From: Kieron Lanning Date: Fri, 4 Sep 2026 16:05:31 +0100 Subject: [PATCH] fix: concurrency issue ! --- .github/workflows/purview-release.yml | 7 ++----- README.md | 6 +++++- docs/releasing.md | 10 ++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/purview-release.yml b/.github/workflows/purview-release.yml index bb44b35..d11878b 100644 --- a/.github/workflows/purview-release.yml +++ b/.github/workflows/purview-release.yml @@ -21,7 +21,8 @@ on: type: string release-branch: description: >- - Branch that triggers this release (main or release). Used only for the concurrency group. + Branch that triggers this release (main or release). Retained for backward compatibility; + callers now control release serialization via their own concurrency group. required: false default: main type: string @@ -67,10 +68,6 @@ permissions: contents: write packages: read -concurrency: - group: purview-release-${{ inputs.release-branch }} - cancel-in-progress: false - jobs: release: name: Release diff --git a/README.md b/README.md index fd8fb92..f76e2df 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,13 @@ name: Release on: push: branches: [main] +concurrency: + # Serialize releases; callers own concurrency (see docs/releasing.md). + group: release-${{ github.ref }} + cancel-in-progress: false jobs: release: - uses: purview-dev/build/.github/workflows/purview-release.yml@v0.2.0 + uses: purview-dev/build/.github/workflows/purview-release.yml@main with: release-mode: NuGet secrets: inherit diff --git a/docs/releasing.md b/docs/releasing.md index 5da729c..86366ae 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -19,6 +19,16 @@ Each repository is gated by a pull-request build. Two release trigger models are In both models the reusable `purview-release.yml` workflow reads `package.json`'s `version`, skips when the `v{version}` tag already exists, and otherwise runs the pipeline with `Release__Mode` set. Because publication is idempotent (`--skip-duplicate`) and the tag is created by the workflow, re-merging `main` into `release` after a failed release is safe. +The reusable workflow does **not** define a concurrency group. GitHub Actions cancels a run as a deadlock when a caller workflow and the reusable workflow it calls share the same concurrency group (the caller's `purview-release-main` collided with the reusable workflow's `purview-release-${{ inputs.release-branch }}` resolving to the same value, producing *"Canceling since a deadlock was detected for concurrency group"*). Callers must own release serialization by defining their own `concurrency` block: + +```yaml +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false +``` + +The `release-branch` input is retained for backward compatibility only. + ## This repository's CI/CD This repository dogfoods the shared tool. CI performs locked restore, warnings-as-errors compilation, packing, installation from the generated package, then runs `purview-build` against this repository so the project builds and packs itself.