-
Notifications
You must be signed in to change notification settings - Fork 34
122 lines (116 loc) · 5.14 KB
/
Copy pathclaude-docs-check.yml
File metadata and controls
122 lines (116 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: 'Claude Docs Check'
# Validates that PR documentation is properly updated
#
# This workflow checks:
# - CLAUDE.md files are updated when code changes
# - README.md files reflect current state
# - Plugin versions are bumped when plugin code changes
#
# Trigger: Runs on all PRs and can be triggered manually
#
# For more information, see:
# https://github.com/Uniswap/ai-toolkit/blob/main/.github/workflows/CLAUDE.md
on:
pull_request:
types: [opened, synchronize, reopened]
# Manual trigger for re-running on specific PRs
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to check'
required: true
type: string
suggestion_mode:
description: 'How to provide suggestions'
required: false
type: choice
options:
- suggest
- branch
- auto
- check
default: suggest
auto_commit:
description: 'Automatically commit and push suggestions to the PR branch'
required: false
type: boolean
default: false
# Prevent concurrent runs on the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
docs-check:
# Skip if the PR is from a fork (no secrets available) or from an
# unrelated bot such as Dependabot or Renovate.
#
# `docs-check / docs-check` is a REQUIRED status check in this repo's
# `main` ruleset. Because this job calls a reusable workflow, the
# required context only exists while the job runs: a skipped job
# reports under the bare name `docs-check` instead, so
# `docs-check / docs-check` never reports and the PR stays
# `mergeable_state: blocked` permanently. Any condition here that can
# skip the job on a same-repo PR is therefore a merge deadlock, not
# just a skipped check.
#
# Bot identity is matched on the immutable numeric account id, never on
# the login. `209825114` is the `claude[bot]` account — the Claude
# GitHub App (app id 1236702) that opens this repo's agent PRs, whose
# documentation this check is meant to validate. GitHub assigns that id
# at account creation and it survives renames, whereas a login is
# mutable and `contains(login, '[bot]')` tests a naming convention
# rather than an identity. `user.type` is GitHub's own account-kind
# field, so other bots keep being skipped without depending on the
# `[bot]` login suffix either.
#
# SECOND GATE, NOT FIXABLE HERE: clearing this condition lets the job
# start and report the required context, but the job then fails at
# `anthropics/claude-code-action`'s own actor check with "Workflow
# initiated by non-human actor: claude (type: Bot). Add bot to
# allowed_bots list". That action gates on its `allowed_bots` input,
# which defaults to "" (allow no bots) — and the reusable workflow
# called below neither declares an `allowed_bots` input nor forwards
# one to the action, so there is no value this file can pass. Fixing it
# requires `Uniswap/ai-toolkit` to plumb `allowed_bots` through
# `_claude-docs-check.yml`; then this caller passes `claude[bot]`.
# Until that lands, the check reports `failure` on bot PRs rather than
# a real docs verdict. That is strictly better than before — the
# required context reports at all, so the PR is no longer wedged
# pending-forever — but it is not yet a meaningful verdict.
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
(github.event.pull_request.user.type != 'Bot' ||
github.event.pull_request.user.id == 209825114))
uses: Uniswap/ai-toolkit/.github/workflows/_claude-docs-check.yml@c4820d6e62a9488c831e722aac202733fafab5dd # main
with:
pr_number: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
suggestion_mode: ${{ github.event.inputs.suggestion_mode || 'suggest' }}
# `auto_commit` stays manual-dispatch-only. On a `pull_request` event
# `github.event.inputs` is empty, so this expression is always `false`
# there — which is why the docs check has never auto-committed anything
# on a PR. This workflow deliberately does NOT enable `auto_fix`: the
# check reports a verdict and leaves suggestions, and never writes to a
# contributor's branch.
auto_commit: ${{ github.event.inputs.auto_commit == 'true' }}
# Use sonnet for faster, cheaper checks
model: 'claude-sonnet-5'
# Fail if plugin versions aren't bumped
fail_on_missing_version: true
# Fail if documentation is not updated
fail_on_missing_docs: true
# Use main branch of ai-toolkit for scripts
toolkit_ref: 'main'
secrets:
# Use OAuth token (Pro/Max) instead of API key
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# PAT for branch creation
WORKFLOW_PAT: ${{ secrets.WORKFLOW_PAT }}
permissions:
contents: write
pull-requests: write
issues: read
actions: read
id-token: write