Files
vectorcraft/.github/workflows/sonarcloud.yml
T
dependabot[bot] 7d33dbf12f ci(deps): bump step-security/harden-runner
Bumps the actions group with 1 update in the / directory: [step-security/harden-runner](https://github.com/step-security/harden-runner).


Updates `step-security/harden-runner` from 2.22.4 to 2.24.0
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](https://github.com/step-security/harden-runner/compare/1d88384fd173af6ecb012dfd0264a306b711241a...a0aec960f8e7f7f2a0335a089fb53d28a4bedeab)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-12-05 22:54:23 +00:00

56 lines
2.2 KiB
YAML

name: SonarCloud
# Main is analyzed once a day, at the commit the nightly builds: Stage 2 admits a nightly only on
# that commit's own analysis, and nightly-dispatch.yml waits for it before dispatching the signer.
on:
workflow_dispatch:
workflow_run:
workflows: [VectorCraft unsigned nightly]
types: [requested]
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('sonarcloud-main-{0}', github.sha) || format('sonarcloud-{0}', github.ref) }}
# A main run is the analysis a nightly waits for; superseded runs there would never finish.
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
nightly-commit:
name: Nightly commit is main's head
# A workflow_run checks out and analyzes main's head, so main must not have moved since the
# nightly started.
if: github.event_name == 'workflow_run'
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Harden runner
uses: step-security/harden-runner@a0aec960f8e7f7f2a0335a089fb53d28a4bedeab # v2.24.0
with:
egress-policy: audit
- name: Require main's head to be the nightly's commit
env:
NIGHTLY_SHA: ${{ github.event.workflow_run.head_sha }}
RUN_SHA: ${{ github.sha }}
run: |
if [ "$NIGHTLY_SHA" != "$RUN_SHA" ]; then
echo "::error::main moved from $NIGHTLY_SHA to $RUN_SHA after the nightly started; this run would not analyze the nightly's commit"
exit 1
fi
sonarcloud:
needs: nightly-commit
if: ${{ !cancelled() && contains(fromJSON('["success","skipped"]'), needs.nightly-commit.result) }}
# Tracked at @main so org-wide CI improvements propagate without PR churn.
# The reusable workflow defaults build-jobs to 2 so a cold instrumented
# archive stays within hosted-runner memory (craft-common-actions#333).
uses: storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main
with:
python-coverage-source: .github/scripts
python-coverage-script: .github/scripts/tests/test_release_rpm_smoke.py
secrets: inherit