Skip to content
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

Fix code injection warnings in check-codescanning-config internal Action #2781

Merged
merged 8 commits into from
Feb 25, 2025
9 changes: 5 additions & 4 deletions .github/actions/check-codescanning-config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ runs:
- name: Check config
working-directory: ${{ github.action_path }}
shell: bash
run: ts-node ./index.ts "${{ runner.temp }}/user-config.yaml" '${{ inputs.expected-config-file-contents }}'

env:
EXPECTED_CONFIG_FILE_CONTENTS: '${{ inputs.expected-config-file-contents }}'
run: ts-node ./index.ts "$RUNNER_TEMP/user-config.yaml" "$EXPECTED_CONFIG_FILE_CONTENTS"
- name: Clean up
shell: bash
if: always()
run: |
rm -rf ${{ runner.temp }}/codescanning-config-cli-test
rm -rf ${{ runner.temp }}/user-config.yaml
rm -rf $RUNNER_TEMP/codescanning-config-cli-test
rm -rf $RUNNER_TEMP/user-config.yaml
2 changes: 1 addition & 1 deletion .github/actions/check-codescanning-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const actualConfig = loadActualConfig()

const rawExpectedConfig = process.argv[3].trim()
if (!rawExpectedConfig) {
core.info('No expected configuration provided')
core.setFailed('No expected configuration provided')
} else {
core.startGroup('Expected generated user config')
core.info(yaml.dump(JSON.parse(rawExpectedConfig)))
Expand Down
Loading