mirror of
https://github.com/storytold/craft-common-actions.git
synced 2026-11-26 04:23:44 +01:00
* ci: preserve every main-branch Sonar scan * ci: never cancel a running main Sonar scan, as the app repos do Per-run concurrency groups let main scans run side by side, so an older commit's analysis can reach SonarCloud after a newer one. Keep one group per ref and only stop cancelling on main, matching every app repo's sonarcloud.yml.
29 lines
928 B
YAML
29 lines
928 B
YAML
name: SonarCloud Scan
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: sonarcloud-${{ github.ref }}
|
|
# A push to main publishes the analysis: never cancel one mid-scan. A newer push still
|
|
# replaces a queued one, so the latest commit is scanned and analyses arrive in order.
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
sonarcloud:
|
|
# SonarCloud needs the SONAR_TOKEN secret, which GitHub does not expose to
|
|
# pull requests from forks. Skip the scan for fork PRs so they report a
|
|
# neutral "skipped" status instead of a hard failure; it still runs on pushes
|
|
# to main and on same-repo pull requests.
|
|
if: >-
|
|
github.event_name == 'push' ||
|
|
github.event.pull_request.head.repo.full_name == github.repository
|
|
uses: ./.github/workflows/sonarcloud.yml
|
|
secrets: inherit
|