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

APPSEC-618 Enabling SonarQube Source Code Scanning Capability #27

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/assets/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

sonar.sources=.
sonar.language=php
sonar.exclusions=.github/**,**ci/**,**/*.sql,**/*.md,**/*.yml,**/*.xml,**/*.json,**/*.lock,**/*.dist
sonar.projectKey=com.hellofresh:stats-php
sonar.links.homepage=https://github.com/hellofresh/stats-php
sonar.links.issue=https://github.com/hellofresh/stats-php/issues
sonar.links.ci=https://github.com/hellofresh/stats-php/actions
sonar.links.scm=https://github.com/hellofresh/stats-php.git
sonar.scm.provider=git
sonar.sourceEncoding=UTF-8
44 changes: 44 additions & 0 deletions .github/workflows/code_scanning.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: "PR: Code Scanning"

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '30 4 * * 6'

permissions:
id-token: write
contents: read

jobs:
analyze:
name: scanning
runs-on: [ self-hosted, default ]
timeout-minutes: 15
steps:
- name: Import Secrets
id: vault-secrets
uses: hellofresh/jetstream-ci-scripts/actions/vault@master
with:
shared-secrets: |
common/data/defaults GITHUB_TOKEN | GITHUB_TOKEN;
common/data/defaults SONAR_TOKEN | SONAR_TOKEN ;

- name: Checkout source code
uses: actions/checkout@v4

- name: SonarQube Scan
uses: hellofresh/jetstream-ci-scripts/actions/sonar-scanner@master
env:
SONAR_TOKEN: ${{ env.SONAR_TOKEN }}
SONAR_HOST_URL: "https://sonarqube.tools-k8s.hellofresh.io"
with:
args: >
-Dsonar.php.coverage.reportPaths=./coverage.xml
-Dproject.settings=./.github/assets/sonar-project.properties
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}
Loading