Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

fix(ci): make tag-release.yml parseable YAML again

Trevin Chowb6efa6445f53
diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml
index 54a90f5e..ad542e3d 100644
--- a/.github/workflows/tag-release.yml
+++ b/.github/workflows/tag-release.yml
@@ -14,8 +14,12 @@ jobs:
tag:
runs-on: ubuntu-latest
# Only act on the release-prep commit shape produced by prepare-release.yml
- # (or an equivalent manual chore(release) commit).
- if: startsWith(github.event.head_commit.message, 'chore(release): bump version to ')
+ # (or an equivalent manual chore(release) commit). Quote the expression —
+ # a bare `chore(release):` colon is invalid YAML and fails the whole
+ # workflow before any job runs. Use contains (not startsWith) so merge
+ # commits whose subject is "Merge pull request #N …" still match when the
+ # PR title is in the body.
+ if: "contains(github.event.head_commit.message, 'chore(release): bump version to ')"
permissions:
contents: write
actions: write
@@ -36,7 +40,8 @@ jobs:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
run: |
set -euo pipefail
- VERSION="$(printf '%s\n' "${HEAD_MSG}" | head -n1 | sed -n 's/^chore(release): bump version to \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/p')"
+ # Scan every line — merge commits put the chore(release) title in the body.
+ VERSION="$(printf '%s\n' "${HEAD_MSG}" | sed -n 's/^chore(release): bump version to \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/p' | head -n1)"
if [ -z "${VERSION}" ]; then
echo "Could not parse version from commit message: ${HEAD_MSG}"
exit 1
diff --git a/changelog.d/+tag-release-yaml.fixed.md b/changelog.d/+tag-release-yaml.fixed.md
new file mode 100644
index 00000000..83016dbe
--- /dev/null
+++ b/changelog.d/+tag-release-yaml.fixed.md
@@ -0,0 +1 @@
+Tag release workflow YAML now parses on every main push; merge commits can mint `vX.Y.Z` tags again.
diff --git a/tests/test_changelog_workflow.py b/tests/test_changelog_workflow.py
index b22d07a4..ff1173b2 100644
--- a/tests/test_changelog_workflow.py
+++ b/tests/test_changelog_workflow.py
@@ -90,6 +90,34 @@ class TestChangelogWorkflow(unittest.TestCase):
):
self.assertTrue((workflows / name).is_file(), msg=name)
+ def test_tag_release_workflow_yaml_parses(self) -> None:
+ """Bare ``chore(release):`` in an unquoted ``if:`` breaks Actions YAML.
+
+ GitHub then reports the run as failed with zero jobs on every push to
+ main. The expression must be double-quoted; prefer ``contains`` so
+ merge-commit messages still match.
+ """
+ path = ROOT / ".github" / "workflows" / "tag-release.yml"
+ text = path.read_text(encoding="utf-8")
+ try:
+ import yaml # type: ignore[import-untyped]
+ except ImportError: # pragma: no cover - PyYAML not a project dep
+ yaml = None
+ if yaml is not None:
+ yaml.safe_load(text)
+ self.assertRegex(
+ text,
+ r'(?m)^\s+if:\s+"contains\(github\.event\.head_commit\.message, '
+ r"'chore\(release\): bump version to '\)\"\s*$",
+ )
+ # VERSION parse must scan the full message (merge commits put the
+ # chore line in the body, not on line 1).
+ self.assertIn(
+ "sed -n 's/^chore(release): bump version to",
+ text,
+ )
+ self.assertNotIn("| head -n1 | sed -n", text)
+
def test_changelog_guard_run_blocks_stay_indented(self) -> None:
"""Column-0 lines inside ``run: |`` break Actions YAML parsing."""
path = ROOT / ".github" / "workflows" / "changelog-guard.yml"