fix: add missing args input to GitHub Action and fix entrypoint quoting#61
Merged
Conversation
The action.yml was missing the documented `args` input, meaning users could not pass CLI flags (e.g. `-e npm -e java -c ...`) through the GitHub Action. The entrypoint now reads INPUT_ARGS directly, consistent with how the other inputs are handled. Also fixes entrypoint.sh where $PWD was unquoted inside an unnecessary sh -c wrapper, which would break on paths with spaces.
b7830db to
7070e65
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes the GitHub Action interface and entrypoints so users can pass additional CLI flags via an args input, and so the entrypoint behaves correctly in workspaces whose paths contain spaces.
Changes:
- Define the previously undocumented/missing
argsinput inaction.yml. - Update the action entrypoint to read
INPUT_ARGSinstead of relying on$@. - Fix quoting in
entrypoint.shwhen configuring Git safe.directory.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
entrypoint.sh |
Quotes $PWD correctly when setting safe.directory. |
entrypoint-action.sh |
Switches to INPUT_ARGS for forwarding CLI flags to git-that-semver. |
action.yml |
Adds missing inputs.args definition so with: args: works. |
.github/workflows/build.yml |
Updates action-entrypoint test runs to provide INPUT_ARGS (empty) to avoid set -u failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
8
to
10
| if [ "$INPUT_ENV" = "true" ]; then | ||
| env_result=$(git-that-semver "$@") | ||
| env_result=$(git-that-semver $INPUT_ARGS) | ||
| echo "$env_result" | tee -a "$GITHUB_OUTPUT" |
Comment on lines
19
to
21
| if [ "$INPUT_JSON" = "true" ]; then | ||
| json_result=$(git-that-semver "$@" -o json -c output.json.indent=2) | ||
| json_result=$(git-that-semver $INPUT_ARGS -o json -c output.json.indent=2) | ||
| { |
Comment on lines
34
to
36
| if [ "$INPUT_YAML" = "true" ]; then | ||
| yaml_result=$(git-that-semver "$@" -o yaml) | ||
| yaml_result=$(git-that-semver $INPUT_ARGS -o yaml) | ||
| { |
Comment on lines
92
to
96
| -e INPUT_ENV=true \ | ||
| -e INPUT_JSON=false \ | ||
| -e INPUT_YAML=false \ | ||
| -e INPUT_ARGS="" \ | ||
| -e GITHUB_ACTIONS=true \ |
Comment on lines
+124
to
+128
| -e INPUT_ENV=true \ | ||
| -e INPUT_JSON=false \ | ||
| -e INPUT_YAML=false \ | ||
| -e INPUT_ARGS="-e npm" \ | ||
| -e GITHUB_ACTIONS=true \ |
| @@ -123,6 +151,7 @@ jobs: | |||
| -e INPUT_ENV=false \ | |||
| -e INPUT_JSON=true \ | |||
| -e INPUT_YAML=false \ | |||
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
argsinput toaction.yml— all documentation references this input but it was never defined, meaning users could not pass CLI flags (e.g.-e npm -e java -c ...) through the GitHub ActionINPUT_ARGSenv var — consistent with howINPUT_ENV,INPUT_JSON,INPUT_YAMLare already handled. Replaces the unused$@passthrough.entrypoint.shquoting —$PWDwas unquoted inside an unnecessarysh -cwrapper, breaking on paths with spaces. Now matches the correct pattern inentrypoint-action.sh.Test plan
INPUT_ARGS=""to cover the new env varargs: "-e npm"to confirm args are forwarded