Skip to content

Commit

Permalink
Added in the sonar job
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorHalf committed Feb 13, 2024
1 parent b6ccada commit 7ac8f0e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/pr-plan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PR-checks

on:
push:
branches: ["develop", 'feature/CB2-10760']
pull_request:
branches: ["develop", 'feature/CB2-10760']

jobs:
scanner:
permissions:
id-token: write
contents: write
pull-requests: write
runs-on: X64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CVS_MGMT_AWS_ROLE }}
aws-region: ${{ secrets.DVSA_AWS_REGION }}
role-session-name: "cvs-tsk-retro=gen"
- uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
secret-ids: sonarqube-gha
parse-json-secrets: true
- name: Install dependencies
run: npm ci
- name: Run SonarQube scanner
run: |
npm run test && \
npm run sonar-scanner -- \
-Dsonar.host.url=${{ env.SONARQUBE_GHA_URL }} \
-Dsonar.token=${{ env.SONARQUBE_GHA_TOKEN }} \
-Dsonar.login=${{ env.SONARQUBE_GHA_TOKEN }} \
-Dsonar.projectName=${{ github.repository }} \
-Dsonar.projectVersion=1.0.${{ github.run_id }}
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"serverless-plugin-tracing": "^2.0.0",
"serverless-plugin-typescript": "^1.1.9",
"sinon": "^8.1.1",
"sonar-scanner": "^3.1.0",
"ts-jest": "^24.3.0",
"tslint": "^5.20.1",
"typescript": "4.4.4"
Expand All @@ -77,4 +78,4 @@
"pre-push": "npm run prepush"
}
}
}
}

0 comments on commit 7ac8f0e

Please sign in to comment.