fix: action hooks not invoked when config is specified#155
Merged
justinmchase merged 2 commits intomainfrom Apr 8, 2026
Merged
fix: action hooks not invoked when config is specified#155justinmchase merged 2 commits intomainfrom
justinmchase merged 2 commits intomainfrom
Conversation
|
|
The CONFIG env var was constructed with embedded quotes:
format(' --config \"{0}\"', inputs.config)
When bash expanded $CONFIG unquoted, the path became '".github/version.yml"'
(with literal double-quote characters), which doesn't exist on disk.
Since the config path was non-empty, post.ts didn't fall back to the default
path, so hooks were never invoked.
Fix: pass raw values through env vars and use bash arrays with conditionals
to construct arguments safely, as suggested in the issue.
Agent-Logs-Url: https://github.com/Optum/semver-cli/sessions/5bc2ff24-fbec-44e7-a3de-97e9254885be
Co-authored-by: justinmchase <10974+justinmchase@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix bug where action does not work when CONFIG is specified
fix: action hooks not invoked when config is specified
Apr 8, 2026
justinmchase
approved these changes
Apr 8, 2026
Contributor
joshuaseligman18
left a comment
There was a problem hiding this comment.
Tested and verified it works when inputs.config is not empty. Happy to see the correct BASH syntax for argument expansion for properly handling all inputs and setting the pattern for future inputs.
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.
Post-version hooks were silently skipped whenever the action ran with a
configinput (including the default.github/version.yml). TheCONFIGenv var was built with embedded shell quotes viaformat(' --config \"{0}\"', inputs.config), and because$CONFIGwas expanded unquoted in therunscript, the path passed to the CLI was".github/version.yml"— literal quote characters included. SinceconfigPathwas non-empty,post.tsnever fell back to the default path lookup, and hooks were never invoked.Changes
action.yml: Replace the single-linesemver $VAR...expansion with a bash array approach, passing raw values through env vars and adding flags conditionally:This also correctly handles values with spaces (e.g.
sortwith multiple versions) sincesort.tsalready splits on whitespace internally.