-
Notifications
You must be signed in to change notification settings - Fork 13
Add some debug output around version selection #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
namespacebrian
wants to merge
3
commits into
main
Choose a base branch
from
debug
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
- name: Install Terminus | ||
shell: bash | ||
run: | | ||
FINAL_VERSION="${{ inputs.terminus-version || env.TERMINUS_RELEASE }}" |
Check warning
Code scanning / CodeQL
Code injection Medium
Potential code injection in , which may be controlled by an external user.
Potential code injection in , which may be controlled by an external user.
${ inputs.terminus-version || env.TERMINUS_RELEASE }
Error loading related location
Loading Potential code injection in
${ inputs.terminus-version || env.TERMINUS_RELEASE }
Error loading related location
Loading
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 months ago
To fix the issue, we will:
- Assign the untrusted input (
inputs.terminus-version || env.TERMINUS_RELEASE
) to an intermediate environment variable. - Use the shell's native syntax (
$VARIABLE
) to reference the environment variable in the script, instead of directly interpolating it with${{ ... }}
. - Ensure that the input is sanitized or validated before use, if necessary.
This approach prevents direct interpolation of untrusted input into the shell script, mitigating the risk of code injection.
Suggested changeset
1
action.yml
-
Copy modified line R55 -
Copy modified line R92
@@ -54,3 +54,3 @@ | ||
run: | | ||
FINAL_VERSION="${{ inputs.terminus-version || env.TERMINUS_RELEASE }}" | ||
FINAL_VERSION="$TERMINUS_VERSION" | ||
|
||
@@ -91,3 +91,3 @@ | ||
env: | ||
TERMINUS_RELEASE: ${{ inputs.terminus-version || env.TERMINUS_RELEASE }} | ||
TERMINUS_VERSION: ${{ inputs.terminus-version || env.TERMINUS_RELEASE }} | ||
DEBUG: ${{ inputs.debug }} |
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
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.
When I tested this, it didn't seem to print the additional information and I'm not sure why.