Conversation
69a6d24 to
af5f9c0
Compare
There was a problem hiding this comment.
Pull Request Overview
Enhance security by validating environment variables and action inputs, and restrict modifications to the CODEOWNERS file.
- Add presence and format checks for GitHub environment variables and version output in
find_version.sh - Introduce input and context variable validations in workflow definitions (
releasability-status/action.yml,action.yml) - Protect the CODEOWNERS file itself by assigning owners explicitly
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| releasability-status/find_version.sh | Added env var presence checks, regex validations, and safe API URL build |
| releasability-status/action.yml | Validated optional_checks input and GitHub context variables |
| action.yml | Validated action inputs (organization, repository, branch, version, commit-sha, environment) before running commands |
| .github/CODEOWNERS | Assigned explicit ownership to protect the CODEOWNERS file |
Comments suppressed due to low confidence (4)
action.yml:119
- The input name
releasabily-envis misspelled, so this validation block never runs. It should bereleasability-envto match the intended input.
if [[ ! "${{ inputs.releasabily-env }}" =~ ^(prod|staging|dev)$ ]]; then
releasability-status/action.yml:35
- [nitpick] The
optional_checksregex only allows alphanumeric, commas, and spaces, but context names often include hyphens and underscores. Consider adding-and_to the allowed characters.
if [[ ! "${{ inputs.optional_checks }}" =~ ^[a-zA-Z0-9, ]*$ ]]; then
action.yml:96
- The repository name validation includes
\sto allow spaces, but GitHub repository names cannot contain spaces. Consider removing whitespace from the allowed pattern.
if [[ ! "${{ inputs.repository }}" =~ ^[a-zA-Z0-9][a-zA-Z0-9._\s-]*[a-zA-Z0-9]$ ]] || [[ "${{ inputs.repository }}" =~ \.git$ ]]; then
releasability-status/find_version.sh:8
- Consider adding automated tests for the new environment variable and version format validations to ensure they behave correctly under both valid and invalid inputs.
# Validate environment variables
71cd8bd to
e2d727f
Compare
e2d727f to
93e5259
Compare
|
julien-carsique-sonarsource
approved these changes
Jul 8, 2025
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.



No description provided.