diff --git a/.github/workflows/ubuntu-latest-docs.yml b/.github/workflows/ubuntu-latest-docs.yml index d1c06f746..1d69dd5bf 100644 --- a/.github/workflows/ubuntu-latest-docs.yml +++ b/.github/workflows/ubuntu-latest-docs.yml @@ -21,6 +21,7 @@ on: pull_request: branches: - main + - 'release/v*' paths: - 'docs/**' - '.assets/**' diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index 73c0e46c4..ab40a8071 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -20,6 +20,7 @@ on: pull_request: branches: - main + - 'release/v*' paths-ignore: - 'docs/**' - '.assets/**' diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index 6c9c0ce79..ddb849f52 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -32,7 +32,9 @@ FetchDepth = 0, Submodules = GitHubActionsSubmodules.Recursive, CheckoutRef = "${{ github.head_ref }}", - OnPullRequestBranches = new[] { MainBranch }, + // Trigger for PRs targeting main OR any release/vN branch — both are + // long-lived and protected; both require the ubuntu-latest status check. + OnPullRequestBranches = new[] { MainBranch, ReleaseBranchPattern }, OnPullRequestExcludePaths = new[] { "docs/**", ".assets/**", "**/*.md" }, InvokedTargets = new[] { nameof(ITest.Test), nameof(IPack.Pack) }, PublishArtifacts = false)] diff --git a/build/Build.cs b/build/Build.cs index 35b724935..3a6ed903d 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -46,6 +46,13 @@ partial class Build const string MainBranch = "main"; + // Glob matching the long-lived release-branch family (release/v11, release/v12, ...). + // Used by Build.CI.GitHubActions to extend PR-validation workflows to cover PRs + // targeting any release branch — branch protection on release/vN requires the + // ubuntu-latest status check, which only fires if the workflow's branches: list + // matches the PR's base ref. See milestone #13. + const string ReleaseBranchPattern = "release/v*"; + // Trunk-based versioning. Nerdbank.GitVersioning computes the canonical version // (major.minor from version.json + git-height as patch). ThisAssembly is generated by // NB.GV at compile time; AssemblyInformationalVersion looks like "10.3.5+abc1234" so we