Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
802bf88184 | ||
|
|
a6104e7ee4 | ||
|
|
42fef39f2a | ||
|
|
ef61b6021f | ||
|
|
500f8e1411 | ||
|
|
4690589d97 | ||
|
|
cdb14cba33 | ||
|
|
3b1a0d504d | ||
|
|
cdefb11fbe |
12
.github/workflows/qa-main.yml
vendored
12
.github/workflows/qa-main.yml
vendored
@@ -12,6 +12,7 @@ jobs:
|
|||||||
name: >
|
name: >
|
||||||
No inputs
|
No inputs
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ github-ubuntu-latest-s, macos-latest ]
|
os: [ github-ubuntu-latest-s, macos-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -31,6 +32,7 @@ jobs:
|
|||||||
name: >
|
name: >
|
||||||
'args' input
|
'args' input
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -48,12 +50,13 @@ jobs:
|
|||||||
- name: Assert
|
- name: Assert
|
||||||
run: |
|
run: |
|
||||||
./test/assertFileContains ./output.properties "sonar.someArg=aValue"
|
./test/assertFileContains ./output.properties "sonar.someArg=aValue"
|
||||||
./test/assertFileContains ./output.properties 'sonar.anotherArgWithSpaces="Another Value"'
|
./test/assertFileContains ./output.properties "sonar.anotherArgWithSpaces=Another Value"
|
||||||
./test/assertFileContains ./output.properties "sonar.argWithSingleQuotes='Another Value'"
|
./test/assertFileContains ./output.properties "sonar.argWithSingleQuotes=Another Value"
|
||||||
argsInputInjectionTest:
|
argsInputInjectionTest:
|
||||||
name: >
|
name: >
|
||||||
'args' input with command injection will fail
|
'args' input with command injection will fail
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
||||||
args: [ -Dsonar.someArg=aValue && echo "Injection", -Dsonar.someArg="value\"; whoami; echo \"" ]
|
args: [ -Dsonar.someArg=aValue && echo "Injection", -Dsonar.someArg="value\"; whoami; echo \"" ]
|
||||||
@@ -63,6 +66,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Run action with args
|
- name: Run action with args
|
||||||
|
id: runTest
|
||||||
uses: ./
|
uses: ./
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
@@ -80,6 +84,7 @@ jobs:
|
|||||||
name: >
|
name: >
|
||||||
'args' input with backticks injection does not execute command
|
'args' input with backticks injection does not execute command
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -380,6 +385,7 @@ jobs:
|
|||||||
name: >
|
name: >
|
||||||
'RUNNER_DEBUG' is used
|
'RUNNER_DEBUG' is used
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -439,6 +445,7 @@ jobs:
|
|||||||
name: >
|
name: >
|
||||||
'SONARCLOUD_URL' is used
|
'SONARCLOUD_URL' is used
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -578,6 +585,7 @@ jobs:
|
|||||||
name: >
|
name: >
|
||||||
'SONAR_ROOT_CERT' is converted to truststore
|
'SONAR_ROOT_CERT' is converted to truststore
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
os: [ github-ubuntu-latest-s, github-windows-latest-s, macos-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|||||||
18
action.yml
18
action.yml
@@ -51,9 +51,19 @@ runs:
|
|||||||
run: echo "${RUNNER_TEMP}/sonar-scanner-cli-${{ inputs.scannerVersion }}-${{ runner.os }}-${{ runner.arch }}/bin" >> $GITHUB_PATH
|
run: echo "${RUNNER_TEMP}/sonar-scanner-cli-${{ inputs.scannerVersion }}-${{ runner.os }}-${{ runner.arch }}/bin" >> $GITHUB_PATH
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Run SonarScanner
|
- name: Run SonarScanner
|
||||||
run: ${GITHUB_ACTION_PATH}/scripts/run-sonar-scanner.sh
|
uses: satackey/action-js-inline@v0.0.2
|
||||||
shell: bash
|
with:
|
||||||
|
required-packages: "string-argv"
|
||||||
|
script: |
|
||||||
|
const core = require('@actions/core')
|
||||||
|
const exec = require('@actions/exec')
|
||||||
|
const { parseArgsStringToArgv } = require('string-argv');
|
||||||
|
|
||||||
|
const IS_WINDOWS = process.platform === 'win32'
|
||||||
|
const runnerTemp = process.env.RUNNER_TEMP
|
||||||
|
|
||||||
|
var args = parseArgsStringToArgv(core.getInput('args'));
|
||||||
|
|
||||||
|
exec.exec(IS_WINDOWS ? 'sonar-scanner.bat' : 'sonar-scanner', args);
|
||||||
env:
|
env:
|
||||||
INPUT_ARGS: ${{ inputs.args }}
|
INPUT_ARGS: ${{ inputs.args }}
|
||||||
INPUT_PROJECTBASEDIR: ${{ inputs.projectBaseDir }}
|
|
||||||
SONAR_SCANNER_JRE: ${{ runner.temp }}/sonar-scanner-cli-${{ inputs.scannerVersion }}-${{ runner.os }}-${{ runner.arch }}/jre
|
|
||||||
|
|||||||
Reference in New Issue
Block a user