Skip to content

Commit 283a555

Browse files
fix: action hooks not invoked when config is specified (#155)
* Initial plan * fix: fix action.yml config arg passing to avoid literal quotes in path 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> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: justinmchase <10974+justinmchase@users.noreply.github.com>
1 parent 62896dc commit 283a555

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

action.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,19 @@ runs:
9696
name: Run Semver ${{ inputs.command }}
9797
shell: bash
9898
run: |
99-
semver $COMMAND $SUB_COMMAND $VALUE $COMPARE_TO $PRERELEASE $BUILD $CONFIG
99+
ARGS=("$COMMAND")
100+
[[ -n "$SUB_COMMAND" ]] && ARGS+=("$SUB_COMMAND")
101+
[[ -n "$VALUE" ]] && ARGS+=("$VALUE")
102+
[[ -n "$COMPARE_TO" ]] && ARGS+=("$COMPARE_TO")
103+
[[ -n "$PRERELEASE" ]] && ARGS+=("--prerelease" "$PRERELEASE")
104+
[[ -n "$BUILD" ]] && ARGS+=("--build" "$BUILD")
105+
[[ -n "$CONFIG" ]] && ARGS+=("--config" "$CONFIG")
106+
semver "${ARGS[@]}"
100107
env:
101108
COMMAND: "${{ inputs.command }}"
102109
SUB_COMMAND: "${{ inputs.sub-command }}"
103-
VALUE: "${{ inputs.value && format(' {0}', inputs.value) || '' }}"
104-
COMPARE_TO: "${{ inputs.compare-to && format('{0}', inputs.compare-to) || '' }}"
105-
PRERELEASE: "${{ inputs.prerelease && format('--prerelease {0}', inputs.prerelease) || '' }}"
106-
BUILD: "${{ inputs.build && format(' --build {0}', inputs.build) || '' }}"
107-
CONFIG: "${{ inputs.config && format(' --config \"{0}\"', inputs.config) || '' }}"
110+
VALUE: "${{ inputs.value }}"
111+
COMPARE_TO: "${{ inputs.compare-to }}"
112+
PRERELEASE: "${{ inputs.prerelease }}"
113+
BUILD: "${{ inputs.build }}"
114+
CONFIG: "${{ inputs.config }}"

0 commit comments

Comments
 (0)