Open
Conversation
- composite action installs the pre-built binary — no Rust toolchain needed - auto-tags on push to main via `uses: sjquant/flopha@v1` - tag-action.yml keeps the floating v1 tag pointing at each stable release https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
- add `version` input to pin the flopha binary version - add `dry-run` input to preview the next tag without pushing - emit actionable error with permissions hint on push failure - use `git config --local` to avoid polluting global git config - narrow tag-action.yml permissions to job level - add comment on when to bump floating tag from v1 → v2 - mention Windows-not-supported in platform error message https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
82a6b24 to
437fd8e
Compare
The floating v1 tag can be updated manually during the release process. No need for a dedicated workflow. https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
Scripts: - action/install.sh — binary download, version-pinnable, clear platform errors - action/run.sh — tag creation, push, optional GitHub Release via gh CLI New action inputs: - create-release — create a GitHub Release for the new tag - draft — create the release as a draft - release-title — custom release title (defaults to tag name) - release-body — custom release body (overrides generate-release-notes) - generate-release-notes — auto-generate notes via GitHub API (default: true) - version — pin the flopha binary version New action outputs: - version — bare semver extracted from the tag (e.g. 1.2.3 from v1.2.3) - release-url — URL of the created GitHub Release Test env (.github/workflows/test-action.yml): - dry-run (auto) — asserts tag/version outputs match semver - dry-run (pattern) — asserts custom pattern is applied - dry-run (pre) — asserts pre-release suffix is present - install (ubuntu + macos) — verifies binary installs and runs - install (pinned) — verifies version-pinned install https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
- Install to \$HOME/.flopha/bin instead of /usr/local/bin (no root needed on Linux runners); chmod +x after extraction; add to GITHUB_PATH - Replace grep -oP (unavailable on macOS BSD grep) with bash parameter expansion for bare version extraction - Fix dry-run-pattern test: repo has no release-X.Y.Z tags so flopha returned "No version found"; replaced with manual minor-bump test against existing v* tags, asserting patch resets to 0 https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
- install.sh: skip download if flopha already on PATH (allows test workflow to inject a source-built binary via artifact) - run.sh: explicitly export PATH to \$HOME/.flopha/bin so flopha is always found without relying on \$GITHUB_PATH propagation between composite-action steps - Cargo.toml: bump to 0.3.0 so the release on merge ships the binary with --auto / --pre / --rule support - test-action.yml: add build job that compiles from source and uploads an artifact; dry-run jobs download that artifact and pre-place it at \$HOME/.flopha/bin so install.sh skips the download and the tests run against the actual current code https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
Users can now pass any regex directly via `major-pattern` and `minor-pattern` instead of being locked to conventional commits. Priority: `rule` > `major/minor-pattern` > built-in defaults. A new dry-run-pattern CI job validates the inputs end-to-end. https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
Blocking fixes: - install.sh: detect download failures (temp file + curl --fail) - run.sh: capture git push stderr; delete local tag on push failure - run.sh: separate release error output from RELEASE_URL variable - action.yml: pass TAG via env var in extract-version step (shell injection) Other improvements: - Rename version input to flopha-version (avoids shadowing version output) - Warn when increment is ignored with auto: true - Document that major/minor-pattern replaces both built-in defaults - Add permissions: contents: read to all test jobs - Add dry-run-rule CI job to test multiline rule input - Annotate install-pinned version pin with explanatory comment - Add comprehensive GitHub Action section to README https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
Explicitly setting permissions: contents: read drops the default actions: read scope, which actions/download-artifact@v4 needs to locate artifacts from other jobs. All 5 dry-run jobs were failing. https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
- generate-release-notes defaults to false (opt-in, not opt-out) - install.sh: don't log "flopha flopha X.Y.Z" (avoid double prefix) - install.sh: mkdir -p BIN_DIR before appending to GITHUB_PATH on skip path, so subsequent steps don't get a missing-dir on PATH https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
Without this step, install.sh inside the composite action can't find the source-built binary (not yet on PATH), falls through to download the latest release, and overwrites the artifact with an older binary that lacks --auto/--pre/--rule support, causing all dry-run jobs to fail. https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
The previous implementation relied on regex::escape escaping {} in a
specific way, then unescaping the placeholders. This chain could produce
wrong regexes (duplicate capture group names) depending on the regex
crate version or input.
Replace with a sentinel approach: substitute placeholders with \x01-
delimited sentinels before escaping (so regex::escape never touches
them), then swap sentinels for the actual capture groups afterward.
https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
CARGO_INCREMENTAL=0 forces cargo to relink from object files each run, preventing Swatinem/rust-cache from serving a compiled versioning.rs that pre-dates the get_regex sentinel fix. https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
Bash finds the first } in a \${VAR:-default} expression as the closing
brace of the expansion, regardless of nesting. So:
\${INPUT_PATTERN:-v{major}.{minor}.{patch}}
closes at the } after 'major', and .{minor}.{patch}} is appended as
literal text, corrupting the pattern to:
v{major}.{minor}.{patch}.{minor}.{patch}}
Since action.yml provides defaults for every input, INPUT_* vars are
always set — replace all \${VAR:-default} forms with plain \$VAR.
https://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL
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
This PR introduces a GitHub Action wrapper for
flopha, enabling automated semantic versioning and tag creation based on conventional commits within GitHub workflows.Key Changes
action.yml: New GitHub Action definition that:
flophaCLI tool for automated version bumpingauto(conventional commit detection),increment(manual bump level),pattern(tag format),pre(pre-release channel),rule(custom bump rules), andgithub-token.github/workflows/tag-action.yml: New workflow that:
v1tag on published releases (excluding pre-releases)owner/repo@v1for the latest stable versionNotable Implementation Details
git fetch --unshallowwith error suppression to handle both shallow and full clonesunameto determine the correct binary targetflophavia environment variables and conditionally added to the command argumentsactions/checkout@v4with explicit ref targeting to ensure correct tag contexthttps://claude.ai/code/session_017tUnFZgkNcbdN8LAS9vsRL