Skip to content

ci: pin actions, least-privilege permissions, OS/JDK matrix, fork-safe Sonar - #118

Merged
alfespa17 merged 3 commits into
masterfrom
ci/harden-workflows
Nov 18, 2026
Merged

alfespa17 merged 3 commits into
masterfrom
ci/harden-workflows

Conversation

@Macbet

@Macbet Macbet commented Nov 18, 2026

Copy link
Copy Markdown

Admin action needed before merging: the required status check on master (if any) must become CI status. The old job publish no longer exists, so a protection rule that requires it would block every PR. I can't see branch protection with maintain rights.

build.yml

  • actions/checkout, setup-java and cache moved to their current majors (v7.0.1 / v6.3.0 / v6.1.0), pinned by full commit SHA.
  • permissions: contents: read, pull-requests: read.
  • Matrix: ubuntu-latest and macos-latest × JDK 17 and 21 (Liberica, available for macOS arm64), fail-fast: false, Maven cache via setup-java.
  • mvn verify always runs. SonarCloud runs as a separate step on ubuntu/JDK 17 only, and only when SONAR_TOKEN is available, so PRs from forks no longer fail. No pull_request_target. A push to master without the token logs a warning.
  • New aggregate job CI status (needs: build, if: always()) that fails unless every matrix cell passed. One stable name for branch protection.
  • Sonar project key and organisation are unchanged (AzBuilder_terraform-spring-boot / azbuilder). Renaming them needs the SonarCloud admin.

maven-publish.yml

  • Triggers on release published instead of created (which also fired for drafts).
  • Drops packages: write. Publishing goes to Maven Central, not GitHub Packages.
  • The pinned Maven 3.9.16 download is checked against Apache's .sha512 (set -euo pipefail, curl -f).
  • Actions pinned by SHA; typo in a step name fixed. Version setting, deploy step and secret names are unchanged.

dependabot.yml

  • Adds the github-actions ecosystem (weekly, prefix ci).

actionlint with shellcheck is clean. The macOS cells and the release workflow will only be proven by their first real run.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@alfespa17
alfespa17 merged commit c5bcadd into master Nov 18, 2026
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants