setup-java/.github
Bruno Borges 1d25252804
chore: Harden workflows: least-privilege permissions + zizmor integration (#1039)
* Harden workflows with least-privilege permissions and zizmor

Apply GitHub Actions security best practices to the action's own
workflows and integrate zizmor to catch regressions.

- Add explicit least-privilege `permissions:` to every workflow
  (contents: read for read-only workflows; default-deny `{}` with
  job-scoped grants for codeql, publish-immutable-actions and
  update-config-files).
- Set `persist-credentials: false` on all checkout steps that don't
  need the GITHUB_TOKEN afterwards.
- Move `${{ ... }}` expansions out of `run:` blocks into `env:` vars
  to avoid template injection.
- Pin the alpine container image (alpine:latest -> alpine:3.21).
- Add a zizmor CI workflow that uploads SARIF to code scanning, plus a
  `.github/zizmor.yml` pinning policy (ref-pin for actions/* and
  github/*, hash-pin for third-party actions).

zizmor now reports no findings (offline and online).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fix indentation of if: in zizmor SARIF upload step

The `if:` key on the "Upload SARIF results to code scanning" step had no
indentation, producing invalid YAML ("Nested mappings are not allowed in
compact mappings"). This broke `npm run format-check` (prettier) in Basic
validation.

Indent `if:` to 8 spaces so it nests under the step alongside uses/with.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-23 18:10:17 +01:00
..
ISSUE_TEMPLATE Templates for new Java distributions (#429) 2026-06-22 17:11:20 -04:00
PULL_REQUEST_TEMPLATE Templates for new Java distributions (#429) 2026-06-22 17:11:20 -04:00
workflows chore: Harden workflows: least-privilege permissions + zizmor integration (#1039) 2026-06-23 18:10:17 +01:00
CODEOWNERS Update CODEOWNERS 2022-12-26 09:43:06 +01:00
dependabot.yml Create dependabot.yml (#722) 2025-01-21 16:15:18 -06:00
java.json add javac problem matcher (#562) 2026-06-22 16:37:47 -04:00
pull_request_template.md Add issue and pr templates 2021-02-05 09:44:08 +03:00
zizmor.yml chore: Harden workflows: least-privilege permissions + zizmor integration (#1039) 2026-06-23 18:10:17 +01:00