Skip to content

ci: stop Update README corrupting the plugin version lines (unblocks the 1.0.0 release) - #14

Open
NickJosevski wants to merge 1 commit into
mainfrom
nj/fix-update-readme
Open

ci: stop Update README corrupting the plugin version lines (unblocks the 1.0.0 release)#14
NickJosevski wants to merge 1 commit into
mainfrom
nj/fix-update-readme

Conversation

@NickJosevski

Copy link
Copy Markdown
Contributor

The problem

The 1.0.0 release PR (#13) has a failing Lint check, so the release is blocked. The cause is this workflow, not the release.

Update README rewrites the plugin version in the README's examples with:

sed -i "s/\(OctopusDeploy\/create-release#\).*/\1v${VERSION}/g" README.md

.* also consumes the trailing colon of the YAML mapping key:

-      - OctopusDeploy/create-release#v0.1.1:
+      - OctopusDeploy/create-release#v1.0.0

Every example then becomes an unkeyed sequence entry followed by indented mappings, and the plugin linter rejects it:

not ok 2 - bad indentation of a sequence entry (8:18)
   7 |       - OctopusDeploy/create-release#v1.0.0
   8 |           project: "HelloWorld"  ----^

This bug has been present since the workflow was added. It simply never ran — there has been no release since 2022, and update-readme only triggers on pushes to release-please--**.

The fix

-          sed -i "s/\(OctopusDeploy\/create-release#\).*/\1v${VERSION}/g" README.md
+          sed -i -E "s|(OctopusDeploy/create-release#)v?[0-9][^:[:space:]]*:?|\1v${VERSION}:|g" README.md

Matches only the version and always re-emits the colon. Two useful properties:

  • Self-healing — it also repairs a README that a previous run already mangled, which matters because chore(main): release 1.0.0 #13's branch is currently in that state.
  • Still scoped to create-release#, so other plugins' refs are untouched. The README now references OctopusDeploy/octopus-login#v1.0.0, which must keep its own version.

Also: a push race

release-please pushed to the release branch three times in quick succession, so three Update README runs started together and raced on git push. One failed:

! [rejected]  release-please--branches--main -> release-please--branches--main (fetch first)

Two of the three succeeded so the outcome was fine, but it's luck. Added a concurrency group keyed on the ref, with cancel-in-progress: false so the last push still gets applied rather than cancelled.

Verification

Ran the new sed over main's README and linted the result:

ok 1 - plugin.yml configuration is valid
ok 2 - All the readme config examples for plugin id 'OctopusDeploy/create-release' are valid (7 found)

Also confirmed the old sed reproduces #13's exact failure, and that the new one repairs #13's already-corrupted README.

After this merges

release-please will refresh #13's branch, Update README will re-run with the fixed sed, and Lint should go green — unblocking the 1.0.0 release. Worth a check rather than an assumption, since that workflow can only be exercised for real on a release branch.

🤖 Generated with Claude Code

Releasing 1.0.0 (#13) is blocked by a failing Lint check, and the cause is
this workflow, not the release.

The sed used `.*` after `create-release#`, which also consumed the trailing
colon of the YAML mapping key:

  - OctopusDeploy/create-release#v0.1.1:   ->   - OctopusDeploy/create-release#v1.0.0

Every example then had an unkeyed sequence entry followed by indented
mappings, so the plugin linter fails with "bad indentation of a sequence
entry". The bug has been here since the workflow was added; it simply never
ran, because there has been no release since 2022.

The replacement matches only the version and always re-emits the colon, so
it is also self-healing on a README a previous run already mangled. It
still leaves other plugins' refs (e.g. octopus-login#) alone.

Also adds a concurrency group. release-please pushed to the release branch
three times in quick succession, and the three resulting runs raced on git
push; one failed with "! [rejected] ... (fetch first)".

Verified by running the new sed over main's README and linting the result:
7 examples valid, no YAML errors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant