mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-22 15:02:38 +00:00
This adds GitHub `actionlint` to validate our actions much more thoroughly ahead of time. This would have caught the recent issue of benchmarking workflow. To make this work, the PR adds a `run_actionlint.py` and extends our script utilities to support a release in an archive where we extract the binary. The `prek` check combines `actionlint` with `shellcheck-py` to also check the shell within the actions. It runs on all the workflows and action files. And we fix various existing issues: - Adds missing `description` metadata and missing `id: pages`. - Quotes shell variables across several files. - Document the intentional word-splitting in `clangd_tidy.yaml`. Assisted-by: Antigravity with Gemini
Workflows
Hardening
Workflows are hardened using Step Security tool. Findings for the "Harden Runner" steps are available online.
Allowed endpoints
Most jobs only have a few endpoints, but due to tools which do downloads, a few have significantly more. These are:
- benchmarks.yaml (Bazel, Bencher)
- clangd_tidy.yaml (Bazel)
- prek.yaml (Bazel, prek)
- nightly_release.yaml (Bazel)
- tests.yaml (Bazel)
When updating one of these, consider updating all of them.
We try to keep allowed-endpoints with one per line. Prettier wants to wrap
them, which we fix this with prettier-ignore.
Testing
We keep around an action-test branch in carbon-lang, which can be used to test
triggers with push: configurations. For example:
on:
push:
branches: [action-test]