mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-12-04 00:15:29 +00:00
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>
33 lines
805 B
YAML
33 lines
805 B
YAML
name: Check Grafana Panels
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'grafana/**' # Trigger only when files under the grafana/ directory change
|
|
|
|
# Least-privilege default for every job; jobs that need more grant it explicitly.
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check-panels:
|
|
if: ${{ github.event.pull_request.draft == false }}
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
# Check out the repository
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
# Install jq (required for the script)
|
|
- name: Install jq
|
|
run: sudo apt-get install -y jq
|
|
|
|
# Make the check.sh script executable
|
|
- name: Check grafana dashboards
|
|
run: |
|
|
make check-dashboards
|