Skip to content

Add flag to disable static analysis#624

Merged
juli1 merged 1 commit intomainfrom
julien/github-action-disable-static-analysis
Feb 4, 2025
Merged

Add flag to disable static analysis#624
juli1 merged 1 commit intomainfrom
julien/github-action-disable-static-analysis

Conversation

@juli1
Copy link
Collaborator

@juli1 juli1 commented Feb 3, 2025

What problem are you trying to solve?

We want to add a flag to let the user enable or disable static analysis via environment variable. This will let the GitHub action disable static analysis if a user wants to only use secrets

What is your solution?

Follow the same pattern as secrets except that static analysis is enabled by default. The value has to be explicitely set to false to fail.

Related PR

PR for the GItHub action to inject this variable

SECRETS_ENABLED_VALUE=""
fi

if [ "$STATIC_ANALYSIS_ENABLED" = "false" ]; then
Copy link
Collaborator

@jasonforal jasonforal Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only comment is that in the analyzer itself, we detect "true" or "yes" as the way to enable static analysis, defaulting to true if not passed in.

Is there a reason we don't implement the same logic here? If env variable is not defined or true or yes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The env var is documented to have only true or false (see here) as we did for all GitHub actions.

@juli1 juli1 requested a review from jasonforal February 4, 2025 20:24
@juli1 juli1 merged commit b6a57a2 into main Feb 4, 2025
75 checks passed
@juli1 juli1 deleted the julien/github-action-disable-static-analysis branch February 4, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants