Repository navigation
Add auto-release workflow for patch/dev merges into main - #4
Merged
Merged
Conversation
Adds a pull_request(closed) trigger: merging a PR from branch `patch` bumps the manifest PATCH version, merging from `dev` bumps MINOR and resets PATCH to 0. Any other source branch is a no-op (workflow_dispatch remains available for manual releases with a bump-type input). Also fixes COMPONENT_NAME (was still "solis_modbus" from before the rebrand, which would have made every step operate on a nonexistent path). Requires a repo secret named PAT (a personal access token from an account with bypass rights on the protected main branch) for both the version-bump push and the release upload — main requires PRs, and only a PAT-authenticated push (not the default GITHUB_TOKEN) will trigger this branch's required status checks on the bump commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Failed to generate code suggestions for PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/workflows/release.yaml: when a PR intomainis merged, bump the version inmanifest.jsonand cut a GitHub release automatically.patch→ bump PATCH (X.Y.Z→X.Y.Z+1).dev→ bump MINOR and reset PATCH (X.Y.Z→X.Y+1.0).workflow_dispatchstill works for a manual release, now with an explicitbumpchoice input (patch/minor/major) instead of the old "bump patch if not already higher than the latest tag" heuristic.COMPONENT_NAME— it was stillsolis_modbusfrom before the rebrand, so every step (manifest path, zip, release asset) was pointing at a path that no longer exists.env:, not interpolated directly into shell scripts, to avoid script injection from an attacker-controlled branch name on a fork PR.Required follow-up (cannot be done by this PR)
This workflow needs a repo secret named
PAT— a personal access token from an account with bypass rights on the protectedmainbranch (contents:write scope is enough). It's needed because:mainrequires PRs (branch protection), so only a PAT-authenticated push from an admin account can land the version-bump commit directly.GITHUB_TOKENdoes not trigger other workflows, so the bump commit's required status checks (validate-hacs,validate,test) would never run if we used it instead.Without this secret, the workflow will fail at the "Commit and push version bump" step. The old manual release.yaml already referenced
secrets.PATbut it was never configured, so this isn't a new gap — just now made explicit.Test plan
yaml.safe_load) — no actionlint available locally.PATsecret + an actual patch/dev merge to verify).🤖 Generated with Claude Code