Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6 from mathrix-education/dev
Browse files Browse the repository at this point in the history
chore(release): release version 0.1.1
  • Loading branch information
matbour authored Dec 4, 2019
2 parents ef52baf + c35f425 commit a0c47f9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
INPUT_OPTIONS: |-
sonar.host.url=you.sonarqube.com
sonar.login=no token
INPUT_UNSHALLOW: ${{ matrix.os == 'ubuntu-latest' }}
INPUT_TYPESCRIPT: ${{ matrix.os == 'ubuntu-latest' }}
INPUT_SCAN: ${{ matrix.os == 'ubuntu-latest' }}
INPUT_ARGS: >-
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ inputs:
description: Run Sonar Scanner immediately in the current working directory.
required: false
default: false
unshallow:
description: Fetch a full clone of the repository. Useful when using the SCM feature of Sonar Scanner.
required: false
default: false
args:
description: Additionnal flag to append during the scan. Ignored if `scan` is false.
required: false
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3713,8 +3713,12 @@ function install() {
fs_1.appendFileSync(path_1.resolve(utils_1.getSonarScannerDirectory(), 'conf', 'sonar-scanner.properties'), core.getInput('options'));
}
// Install TypeScript if necessary
if (core.getInput('unshallow').toLowerCase() === 'true') {
yield exec.exec('git fetch --unshallow');
}
// Install TypeScript if necessary
if (core.getInput('typescript').toLowerCase() === 'true') {
yield exec.exec('npm i typescript');
yield exec.exec('npm install typescript --no-package-lock --no-save');
}
// Run Sonar Scanner
if (core.getInput('scan').toLowerCase() === 'true') {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mathrix-education/sonar-scanner",
"version": "0.1.0",
"version": "0.1.1",
"description": "Small GitHub action to install the Sonar Scanner on workflow.",
"keywords": [
"github-actions",
Expand Down
7 changes: 6 additions & 1 deletion src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ export async function install(): Promise<void> {
);
}

// Install TypeScript if necessary
if (core.getInput('unshallow').toLowerCase() === 'true') {
await exec.exec('git fetch --unshallow');
}

// Install TypeScript if necessary
if (core.getInput('typescript').toLowerCase() === 'true') {
await exec.exec('npm i typescript');
await exec.exec('npm install typescript --no-package-lock --no-save');
}

// Run Sonar Scanner
Expand Down

0 comments on commit a0c47f9

Please sign in to comment.