Add a top-level `permissions: contents: read` to the 15 workflows that had
no default, so every job runs with a least-privilege token instead of the
repository's read/write default. Jobs that need more grant it explicitly:
`publish-github-release` (creates the release), the `update-compat-versions`
caller (a caller's permissions are the ceiling for the reusable workflow),
`apidoc` (deploys gh-pages), and nightly-ci `notification` (opens an issue).
Also rewrite the two array-capturing regexes in
`.github/scripts/update-compat-versions.py` from `(?:[^\]]|\n)*?` to
`[^\]]*?`; the alternation was redundant and backtracked exponentially on
newline-heavy input.
Resolves CodeQL `actions/missing-workflow-permissions` (79 alerts) and
`py/redos` (2 alerts).
Signed-off-by: Ning Sun <sunning@greptime.com>
Co-authored-by: dennis zhuang <killme2008@gmail.com>
* ci: save release and dependency-check Rust caches only on main
The macOS and Windows release builds and the dependency check saved Rust
caches on every ref, including tags and PRs. Those caches are unreachable
from other refs and evict main's caches. Save them only on main, and
extend the cache policy test to every workflow and composite action.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* ci: correct the macOS rust-cache key comment
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>