Files
greptimedb/.github/workflows/docs.yml
T
Ning Sunanddennis zhuang 768834c465 ci: scope GITHUB_TOKEN permissions in workflows and fix ReDoS in compat updater (#10739)
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>
2026-12-01 07:29:14 +00:00

88 lines
2.4 KiB
YAML

on:
merge_group:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'docs/**'
- 'config/**'
- '**.md'
- '.dockerignore'
- 'docker/**'
- '.gitignore'
- 'grafana/**'
- 'Makefile'
push:
branches:
- main
paths:
- 'docs/**'
- 'config/**'
- '**.md'
- '.dockerignore'
- 'docker/**'
- '.gitignore'
- 'grafana/**'
- 'Makefile'
workflow_dispatch:
inputs:
ci_command:
description: Internal comment-command marker
required: false
default: false
type: boolean
name: Docs CI
# Least-privilege default for every job; jobs that need more grant it explicitly.
permissions:
contents: read
# To pass the required status check, see:
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
jobs:
typos:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false || github.run_attempt > 1 }}
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: crate-ci/typos@v1.50.2
license-header-check:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false || github.run_attempt > 1 }}
runs-on: ubuntu-latest
name: Check License Header
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: korandoru/hawkeye@v5
required-checks:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false || github.run_attempt > 1 }}
name: ${{ matrix.check }}
runs-on: ubuntu-slim
strategy:
matrix:
check:
- Check
- Rustfmt
- Clippy
- Unused Dependencies
- Sqlness Test (Basic)
- Sqlness Test (Remote WAL)
- test
- coverage
- Sqlness Test (Flat format)
- Compatibility Test (recent releases)
- GitHub Script Tests (Rust CI)
- GitHub Script Tests (Integration CI)
- Check for conflict
- Check Unused Dependencies
- Build GreptimeDB binaries (ubuntu-latest)
steps:
- run: 'echo "No action required"'