[object Object]

← back to Cli Printing Press

fix(ci): allow release-please PR title scope (#248)

bc13a5b4f84aa63b7f935908db1e230895f243dc · 2026-04-23 02:41:24 -0700 · Trevin Chow

Files touched

Diff

commit bc13a5b4f84aa63b7f935908db1e230895f243dc
Author: Trevin Chow <trevin@trevinchow.com>
Date:   Thu Apr 23 02:41:24 2026 -0700

    fix(ci): allow release-please PR title scope (#248)
---
 .github/workflows/pr-title.yml |  1 +
 AGENTS.md                      |  3 +++
 internal/cli/release_test.go   | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)

diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml
index bbbc300d..c8e26dab 100644
--- a/.github/workflows/pr-title.yml
+++ b/.github/workflows/pr-title.yml
@@ -29,6 +29,7 @@ jobs:
             cli
             skills
             ci
+            main
           requireScope: true
           subjectPattern: ^.+$
           subjectPatternError: "PR title must have a description after the colon"
diff --git a/AGENTS.md b/AGENTS.md
index 366ca914..2a1410be 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -116,6 +116,9 @@ Key terms used throughout this repo. Several have overloaded meanings — the gl
 | `cli` | Go binary, commands, flags, embedded catalog, docs | `feat(cli): add catalog subcommands` |
 | `skills` | Skill definitions (SKILL.md), references, setup contract | `fix(skills): remove repo checkout requirement` |
 | `ci` | Workflows, release config, goreleaser | `feat(ci): add release-please` |
+| `main` | release-please generated release PRs targeting `main` | `chore(main): release 2.2.0` |
+
+`main` is reserved for release-please PR titles. Human-authored changes should use `cli`, `skills`, or `ci`.
 
 Every commit and PR title must include one of these scopes. The `PR Title` action enforces this.
 
diff --git a/internal/cli/release_test.go b/internal/cli/release_test.go
index 2e48c88a..f91f4544 100644
--- a/internal/cli/release_test.go
+++ b/internal/cli/release_test.go
@@ -93,3 +93,44 @@ func TestMarketplaceJSONHasNoPluginVersion(t *testing.T) {
 		}
 	}
 }
+
+func TestPRTitleWorkflowAllowsReleasePleaseScope(t *testing.T) {
+	// release-please uses the target branch as the conventional-commit scope
+	// for generated release PR titles, e.g. chore(main): release 2.2.0.
+	// The PR title workflow must allow that generated title or release PRs
+	// cannot merge.
+	data, err := os.ReadFile("../../.github/workflows/pr-title.yml")
+	require.NoError(t, err)
+
+	var workflow struct {
+		Jobs map[string]struct {
+			Steps []struct {
+				Uses string         `yaml:"uses"`
+				With map[string]any `yaml:"with"`
+			} `yaml:"steps"`
+		} `yaml:"jobs"`
+	}
+	require.NoError(t, yaml.Unmarshal(data, &workflow))
+
+	lintJob, ok := workflow.Jobs["lint"]
+	require.True(t, ok, "PR title workflow should have a lint job")
+
+	for _, step := range lintJob.Steps {
+		if !strings.HasPrefix(step.Uses, "amannn/action-semantic-pull-request@") {
+			continue
+		}
+
+		scopes, ok := step.With["scopes"].(string)
+		require.True(t, ok, "semantic pull request action should declare scopes")
+
+		allowed := map[string]bool{}
+		for _, scope := range strings.Fields(scopes) {
+			allowed[scope] = true
+		}
+
+		assert.True(t, allowed["main"], "release-please PR titles use main as the scope")
+		return
+	}
+
+	t.Fatal("PR title workflow should use amannn/action-semantic-pull-request")
+}

← d14cefaa fix(skills): keep scratch artifacts out of repo docs (#247)  ·  back to Cli Printing Press  ·  chore(main): release 2.2.0 (#184) 92c5b2f4 →