-
Notifications
You must be signed in to change notification settings - Fork 0
fixed-remote-url #1
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
base: main
Are you sure you want to change the base?
Conversation
| run: | | ||
| cp package.json ./build | ||
| cd build | ||
| git init | ||
| git config user.email "admin@apty.io" | ||
| git config user.name "git-ci" | ||
| git add . | ||
| git commit -m "${{needs.rules.outputs.branch_name}}-${{github.event.head_commit.message}}" -a | ||
| git remote add origin "git@github.com:aptyInc/tinymce-react.git" | ||
| git checkout -b "${{needs.rules.outputs.branch_name}}-${{ github.sha }}" | ||
| git push origin "${{needs.rules.outputs.branch_name}}-${{ github.sha }}" |
Check failure
Code scanning / CodeQL
Expression injection in Actions Critical
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 months ago
To fix the problem, we need to avoid using user-controlled input directly in the run command. Instead, we should set the untrusted input value to an intermediate environment variable and then use the environment variable using the native shell syntax. This will prevent any potential code injection.
Specifically, we will:
- Set the
branch_nameandcommit_messageto environment variables. - Use these environment variables in the
runcommand using shell syntax.
-
Copy modified lines R73-R76 -
Copy modified line R84 -
Copy modified lines R86-R87
| @@ -72,2 +72,6 @@ | ||
| - name: Commit code for tinymce-react | ||
| env: | ||
| BRANCH_NAME: ${{ needs.rules.outputs.branch_name }} | ||
| COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | ||
| GITHUB_SHA: ${{ github.sha }} | ||
| run: | | ||
| @@ -79,6 +83,6 @@ | ||
| git add . | ||
| git commit -m "${{needs.rules.outputs.branch_name}}-${{github.event.head_commit.message}}" -a | ||
| git commit -m "${BRANCH_NAME}-${COMMIT_MESSAGE}" -a | ||
| git remote add origin "git@github.com:aptyInc/tinymce-react.git" | ||
| git checkout -b "${{needs.rules.outputs.branch_name}}-${{ github.sha }}" | ||
| git push origin "${{needs.rules.outputs.branch_name}}-${{ github.sha }}" | ||
| git checkout -b "${BRANCH_NAME}-${GITHUB_SHA}" | ||
| git push origin "${BRANCH_NAME}-${GITHUB_SHA}" | ||
| notifications: |
Removed remotely hosted URL