Repository navigation
Protect TOAST values needed by shadow replication #30
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: AI review gate (org-required) | ||
|
Check warning on line 1 in ClickHouse/ai-gate/.github/workflows/ai-gate-required.yml
|
||
| # GENERATED by security-integrations' infra/github/ai-gate/public_sync.py from | ||
| # .github/workflows/ai-gate-required.yml there, after every merge to its main. | ||
| # Do not edit here: a change is reviewed and canaried in security-integrations | ||
| # and arrives with the next sync. | ||
| # | ||
| # The org-required form of the gate. An organisation ruleset | ||
| # (enforce-checks-public) pins this file (this repository, this path, | ||
| # refs/heads/main) and GitHub runs it on pull requests in every enrolled | ||
| # public and internal repository. It never checks out the target repository | ||
| # and runs only the trusted action below, so it executes no pull-request | ||
| # code. The ruleset is satisfied by this workflow passing, not by a check | ||
| # name, so a pull request cannot forge the result. | ||
| # | ||
| # Why pull_request_target, and why that is safe here: | ||
| # * This workflow NEVER checks out or executes pull-request code. Its one | ||
| # step is the trusted action at @main of THIS repository — the same trust | ||
| # root the ruleset reads this file from — which fetches its own code there | ||
| # and evaluates the pull request through the GitHub API. Config is read | ||
| # from the BASE branch. A pull_request_target workflow is dangerous only | ||
| # when it checks out or runs the head; this one does neither, and a | ||
| # reviewed change to this file (in security-integrations) is the only way | ||
| # that could change. | ||
| # * The token is scoped by `permissions:` to exactly what the gate reads and | ||
| # the one thing it writes: contents: read (the base branch's | ||
| # .github/ai-gate.yml and CODEOWNERS), checks: read (the reviewer's check | ||
| # runs), pull-requests: write for the single explanatory comment. The | ||
| # action code only ever comments; whether a GITHUB_TOKEN with that | ||
| # permission can also approve depends on the repository's "Allow GitHub | ||
| # Actions to create and approve pull requests" setting, which should stay | ||
| # off. No checks: write (the job's status is the gate; post-check-run: | ||
| # "false"), no actions, no id-token. | ||
| # * Workflows triggered by pull_request_target always run, regardless of the | ||
| # repository's fork-workflow approval policy, so the gate — which runs no | ||
| # fork code — no longer waits at `action_required` for fork pull requests | ||
| # in repositories that require a maintainer's approval for outside | ||
| # contributors, and its token can post the explanatory comment there too. | ||
| # The fork's OWN workflows keep needing that approval. | ||
| # | ||
| # GitHub runs a ruleset-required workflow only on the default activity types | ||
| # of its events (opened, synchronize, reopened; `types:` filters are ignored) | ||
| # and will not re-run it when the reviewer finishes later, so the gate waits | ||
| # for the reviewer within this one run (wait-seconds, fail-closed on timeout). | ||
| # Drafts are not skipped and the job has no `if:`: a skipped required workflow | ||
| # counts as a pass. | ||
| on: | ||
| # The ruleset runs this on opened, synchronize and reopened whatever is | ||
| # listed here (filters are ignored); the list documents what fires. | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened] | ||
| # Only what the gate needs (see above). pull-requests: write posts the one | ||
| # comment explaining why the gate is withheld; a comment cannot change the | ||
| # verdict. | ||
| permissions: | ||
| contents: read | ||
| checks: read | ||
| pull-requests: write | ||
| concurrency: | ||
| group: ai-gate-required-${{ github.event.pull_request.number || github.run_id }} | ||
| cancel-in-progress: false | ||
| jobs: | ||
| gate: | ||
| # No `if:` of any kind: a skipped required job counts as a pass. | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # @main of this repository, on purpose: the org ruleset reads THIS | ||
| # WORKFLOW from refs/heads/main, so main is already the gate's trust | ||
| # root, and an action at @main of the same repository has exactly that | ||
| # protection. Both arrive together from security-integrations' sync. | ||
| - uses: ClickHouse/ai-gate@main | ||
| with: | ||
| mode: enforce | ||
| # Wait for the reviewer within this run (ruleset workflows cannot be | ||
| # re-triggered when the review lands). Fail-closed on timeout. | ||
| wait-seconds: "900" | ||
| # The job status is the gate here and the token has no checks: write. | ||
| post-check-run: "false" | ||