Skip to content

fix(action): correct input validation script behavior#307

Closed
jerop wants to merge 1 commit intomainfrom
fix/validate-inputs-script
Closed

fix(action): correct input validation script behavior#307
jerop wants to merge 1 commit intomainfrom
fix/validate-inputs-script

Conversation

@jerop
Copy link
Copy Markdown
Contributor

@jerop jerop commented Sep 18, 2025

The input validation script was failing silently and incorrectly when exactly one authentication method was provided. This was due to the interaction between 'set -e' and the exit code of Bash arithmetic evaluation.

The post-increment expression 'auth_methods++' evaluates to 0 when auth_methods is 0. In Bash, an arithmetic expression that evaluates to 0 returns an exit code of 1. With 'set -e' enabled, this non-zero exit code caused the script to exit as if an error had occurred.

This commit changes the post-increment to a pre-increment '++auth_methods'. This ensures the expression always evaluates to a non-zero value (1, 2, or 3), resulting in a 0 exit code and preventing the script from failing.

Additionally, the '-x' flag has been added to the 'set' command to enable xtrace, which will print commands as they are executed. This improves the debuggability of the script.

The input validation script was failing silently and incorrectly when exactly one authentication method was provided. This was due to the interaction between 'set -e' and the exit code of Bash arithmetic evaluation.

The post-increment expression 'auth_methods++' evaluates to 0 when auth_methods is 0. In Bash, an arithmetic expression that evaluates to 0 returns an exit code of 1. With 'set -e' enabled, this non-zero exit code caused the script to exit as if an error had occurred.

This commit changes the post-increment to a pre-increment '++auth_methods'. This ensures the expression always evaluates to a non-zero value (1, 2, or 3), resulting in a 0 exit code and preventing the script from failing.

Additionally, the '-x' flag has been added to the 'set' command to enable xtrace, which will print commands as they are executed. This improves the debuggability of the script.
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli Bot commented Sep 18, 2025

🤖 Hi @jerop, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@jerop jerop closed this Sep 18, 2025
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli Bot commented Sep 18, 2025

🤖 I'm sorry @jerop, but I was unable to process your request. Please see the logs for more details.

@jerop jerop deleted the fix/validate-inputs-script branch September 18, 2025 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant