@pecot/workflow-mcp 8.0.1-dev.56 → 8.0.1-dev.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# pecot-workflow-template: review 1
|
|
2
|
+
#
|
|
3
|
+
# Place this file at .github/workflows/pecot-review.yml in your repository.
|
|
4
|
+
#
|
|
5
|
+
# This workflow runs the pecot w-revise skill on a pull request with claude-code-action.
|
|
6
|
+
# It posts inline comments and a list of findings. It never pushes, merges, or closes.
|
|
7
|
+
# It starts when a PR is opened or marked ready for review.
|
|
8
|
+
# To review again, comment "@pecotbot review" on the PR.
|
|
9
|
+
# The phrase must be the whole comment, or be followed by a space or a new line.
|
|
10
|
+
# Only people with write access can start it, and the job checks their permission.
|
|
11
|
+
# PRs from forks and drafts are skipped.
|
|
12
|
+
#
|
|
13
|
+
# Install the Claude GitHub App on the repository.
|
|
14
|
+
# Then set one model credential in Settings > Secrets and variables > Actions.
|
|
15
|
+
# Claude subscription (default).
|
|
16
|
+
# Set secret CLAUDE_CODE_OAUTH_TOKEN, made with `claude setup-token`.
|
|
17
|
+
# Claude Platform with Workload Identity Federation.
|
|
18
|
+
# Leave secret CLAUDE_CODE_OAUTH_TOKEN unset.
|
|
19
|
+
# Set variable PECOT_AGENT_ANTHROPIC_FEDERATION_RULE_ID.
|
|
20
|
+
# Set variable PECOT_AGENT_ANTHROPIC_ORGANIZATION_ID.
|
|
21
|
+
# Set variable PECOT_AGENT_ANTHROPIC_SERVICE_ACCOUNT_ID.
|
|
22
|
+
# Set variable PECOT_AGENT_ANTHROPIC_WORKSPACE_ID.
|
|
23
|
+
#
|
|
24
|
+
# By default, comments come from the Claude GitHub App and github-actions[bot].
|
|
25
|
+
# To post as your own GitHub App, set variable PECOT_AGENT_APP_CLIENT_ID.
|
|
26
|
+
# Also set secret PECOT_AGENT_APP_PRIVATE_KEY.
|
|
27
|
+
# The workflow narrows its token to Pull requests: write and Contents: read.
|
|
28
|
+
#
|
|
29
|
+
# Optional variables. Each one falls back to its default when unset.
|
|
30
|
+
# PECOT_REVIEW_TRIGGER_PHRASE starts a review again. The default is "@pecotbot review".
|
|
31
|
+
# PECOT_REVIEW_ALLOWED_BOTS lists bots whose PRs are reviewed. The default is [].
|
|
32
|
+
# Write it as a JSON array, for example ["my-app[bot]"].
|
|
33
|
+
# PECOT_REVIEW_MAX_TURNS limits the turns of the main agent. The default is 60.
|
|
34
|
+
# PECOT_REVIEW_TIMEOUT_MINUTES limits the job time in minutes. The default is 30.
|
|
35
|
+
#
|
|
36
|
+
# Runs started by Dependabot read Dependabot secrets, not Actions secrets.
|
|
37
|
+
# To review Dependabot PRs, add "dependabot[bot]" to PECOT_REVIEW_ALLOWED_BOTS.
|
|
38
|
+
# Then set the secrets above as Dependabot secrets too.
|
|
39
|
+
#
|
|
40
|
+
# Keep your own lines between the pecot-review:*:begin and :end markers.
|
|
41
|
+
# `pecot workflow install review --force` shows them before it overwrites this file.
|
|
42
|
+
name: pecot review
|
|
43
|
+
|
|
44
|
+
on:
|
|
45
|
+
pull_request:
|
|
46
|
+
types: [opened, ready_for_review]
|
|
47
|
+
issue_comment:
|
|
48
|
+
types: [created]
|
|
49
|
+
|
|
50
|
+
jobs:
|
|
51
|
+
review:
|
|
52
|
+
# A job-level if cannot read env, so the defaults are written next to each variable.
|
|
53
|
+
if: >-
|
|
54
|
+
${{
|
|
55
|
+
(
|
|
56
|
+
github.event_name == 'pull_request' &&
|
|
57
|
+
github.event.pull_request.head.repo.full_name == github.repository &&
|
|
58
|
+
!github.event.pull_request.draft &&
|
|
59
|
+
(
|
|
60
|
+
github.event.pull_request.user.type != 'Bot' ||
|
|
61
|
+
contains(fromJSON(vars.PECOT_REVIEW_ALLOWED_BOTS || '[]'), github.event.pull_request.user.login)
|
|
62
|
+
)
|
|
63
|
+
) ||
|
|
64
|
+
(
|
|
65
|
+
github.event_name == 'issue_comment' &&
|
|
66
|
+
github.event.issue.pull_request &&
|
|
67
|
+
github.event.comment.user.type != 'Bot' &&
|
|
68
|
+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) &&
|
|
69
|
+
(
|
|
70
|
+
github.event.comment.body == (vars.PECOT_REVIEW_TRIGGER_PHRASE || '@pecotbot review') ||
|
|
71
|
+
startsWith(github.event.comment.body, format('{0} ', vars.PECOT_REVIEW_TRIGGER_PHRASE || '@pecotbot review')) ||
|
|
72
|
+
startsWith(github.event.comment.body, format('{0}{1}', vars.PECOT_REVIEW_TRIGGER_PHRASE || '@pecotbot review', fromJSON('"\n"'))) ||
|
|
73
|
+
startsWith(github.event.comment.body, format('{0}{1}', vars.PECOT_REVIEW_TRIGGER_PHRASE || '@pecotbot review', fromJSON('"\r\n"')))
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
}}
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
# Variables are strings, and timeout-minutes needs a number.
|
|
79
|
+
timeout-minutes: ${{ fromJSON(vars.PECOT_REVIEW_TIMEOUT_MINUTES || '30') }}
|
|
80
|
+
concurrency:
|
|
81
|
+
group: pecot-review-${{ github.event.pull_request.number || github.event.issue.number }}
|
|
82
|
+
cancel-in-progress: false
|
|
83
|
+
permissions:
|
|
84
|
+
contents: read
|
|
85
|
+
pull-requests: write
|
|
86
|
+
id-token: write
|
|
87
|
+
env:
|
|
88
|
+
# pecot-review:allowed-tools:begin
|
|
89
|
+
# Tools that your preparation steps need, separated by commas.
|
|
90
|
+
PECOT_REVIEW_EXTRA_ALLOWED_TOOLS: ""
|
|
91
|
+
# pecot-review:allowed-tools:end
|
|
92
|
+
steps:
|
|
93
|
+
- name: Generate GitHub App token
|
|
94
|
+
id: token
|
|
95
|
+
if: ${{ vars.PECOT_AGENT_APP_CLIENT_ID != '' }}
|
|
96
|
+
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
|
|
97
|
+
with:
|
|
98
|
+
client-id: ${{ vars.PECOT_AGENT_APP_CLIENT_ID }}
|
|
99
|
+
private-key: ${{ secrets.PECOT_AGENT_APP_PRIVATE_KEY }}
|
|
100
|
+
permission-pull-requests: write
|
|
101
|
+
permission-contents: read
|
|
102
|
+
|
|
103
|
+
# issue_comment events carry neither the head repository nor the draft flag, so read the PR.
|
|
104
|
+
# author_association also passes read-only collaborators, so read the commenter's permission.
|
|
105
|
+
- name: Check the PR
|
|
106
|
+
id: pr
|
|
107
|
+
if: ${{ github.event_name == 'issue_comment' }}
|
|
108
|
+
env:
|
|
109
|
+
GH_TOKEN: ${{ steps.token.outputs.token || github.token }}
|
|
110
|
+
PR: ${{ github.event.issue.number }}
|
|
111
|
+
COMMENTER: ${{ github.event.comment.user.login }}
|
|
112
|
+
run: |
|
|
113
|
+
pr=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR")
|
|
114
|
+
role=$(gh api "repos/$GITHUB_REPOSITORY/collaborators/$COMMENTER/permission" --jq .role_name)
|
|
115
|
+
head=$(jq -r '.head.repo.full_name // ""' <<< "$pr")
|
|
116
|
+
draft=$(jq -r .draft <<< "$pr")
|
|
117
|
+
state=$(jq -r .state <<< "$pr")
|
|
118
|
+
ok=false
|
|
119
|
+
if [ "$head" = "$GITHUB_REPOSITORY" ] && [ "$draft" = false ] && [ "$state" = open ]; then
|
|
120
|
+
case "$role" in admin|maintain|write) ok=true ;; esac
|
|
121
|
+
fi
|
|
122
|
+
echo "ok=$ok" >> "$GITHUB_OUTPUT"
|
|
123
|
+
echo "sha=$(jq -r .head.sha <<< "$pr")" >> "$GITHUB_OUTPUT"
|
|
124
|
+
|
|
125
|
+
- name: Acknowledge the request
|
|
126
|
+
if: ${{ github.event_name == 'issue_comment' && steps.pr.outputs.ok == 'true' }}
|
|
127
|
+
continue-on-error: true
|
|
128
|
+
env:
|
|
129
|
+
GH_TOKEN: ${{ steps.token.outputs.token || github.token }}
|
|
130
|
+
COMMENT_ID: ${{ github.event.comment.id }}
|
|
131
|
+
run: gh api -X POST "repos/$GITHUB_REPOSITORY/issues/comments/$COMMENT_ID/reactions" -f content=eyes --silent
|
|
132
|
+
|
|
133
|
+
# Read the PR head, not the merge ref, so that review lines match the diff.
|
|
134
|
+
- name: Checkout
|
|
135
|
+
if: ${{ github.event_name == 'pull_request' || steps.pr.outputs.ok == 'true' }}
|
|
136
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
137
|
+
with:
|
|
138
|
+
ref: ${{ github.event.pull_request.head.sha || steps.pr.outputs.sha }}
|
|
139
|
+
fetch-depth: 1
|
|
140
|
+
persist-credentials: false
|
|
141
|
+
|
|
142
|
+
- name: Set up Node.js
|
|
143
|
+
if: ${{ github.event_name == 'pull_request' || steps.pr.outputs.ok == 'true' }}
|
|
144
|
+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
145
|
+
with:
|
|
146
|
+
node-version: "24.22.1"
|
|
147
|
+
|
|
148
|
+
# pecot-review:prepare:begin
|
|
149
|
+
# Add steps that the review needs, such as installing dependencies.
|
|
150
|
+
# Give each step the same if as the steps above.
|
|
151
|
+
# pecot-review:prepare:end
|
|
152
|
+
|
|
153
|
+
- name: Review
|
|
154
|
+
id: claude
|
|
155
|
+
if: ${{ github.event_name == 'pull_request' || steps.pr.outputs.ok == 'true' }}
|
|
156
|
+
uses: anthropics/claude-code-action@cc98b3ae241b0fcfb6a42a2690751afffecb4452 # v1.0.278
|
|
157
|
+
env:
|
|
158
|
+
PECOT_GITHUB_COM_TOKEN: ${{ steps.token.outputs.token || github.token }}
|
|
159
|
+
with:
|
|
160
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
161
|
+
# The action takes either a token or Workload Identity Federation, not both.
|
|
162
|
+
anthropic_federation_rule_id: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN == '' && vars.PECOT_AGENT_ANTHROPIC_FEDERATION_RULE_ID || '' }}
|
|
163
|
+
anthropic_organization_id: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN == '' && vars.PECOT_AGENT_ANTHROPIC_ORGANIZATION_ID || '' }}
|
|
164
|
+
anthropic_service_account_id: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN == '' && vars.PECOT_AGENT_ANTHROPIC_SERVICE_ACCOUNT_ID || '' }}
|
|
165
|
+
anthropic_workspace_id: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN == '' && vars.PECOT_AGENT_ANTHROPIC_WORKSPACE_ID || '' }}
|
|
166
|
+
# Empty when no App token was made, so the action uses the Claude GitHub App.
|
|
167
|
+
github_token: ${{ steps.token.outputs.token }}
|
|
168
|
+
# Without an API key the classifier is skipped; post every inline comment at once.
|
|
169
|
+
classify_inline_comments: "false"
|
|
170
|
+
plugin_marketplaces: https://github.com/pecotcraft/pecot.git
|
|
171
|
+
plugins: pecot-w@pecot
|
|
172
|
+
allowed_bots: ${{ join(fromJSON(vars.PECOT_REVIEW_ALLOWED_BOTS || '[]'), ',') }}
|
|
173
|
+
prompt: /pecot-w:w-revise --unattended ${{ github.repository }}/${{ github.event.pull_request.number || github.event.issue.number }}
|
|
174
|
+
claude_args: >-
|
|
175
|
+
--permission-mode default
|
|
176
|
+
--max-turns ${{ vars.PECOT_REVIEW_MAX_TURNS || '60' }}
|
|
177
|
+
--allowedTools "Read,Glob,Grep,mcp__plugin_pecot-w_pecot-workflow__pr_show,mcp__plugin_pecot-w_pecot-workflow__issue_show,mcp__plugin_pecot-w_pecot-workflow__pr_restack,mcp__plugin_pecot-w_pecot-workflow__issue_comment,mcp__plugin_pecot-w_pecot-workflow__pr_review_finish,mcp__github_inline_comment__create_inline_comment${{ env.PECOT_REVIEW_EXTRA_ALLOWED_TOOLS != '' && format(',{0}', env.PECOT_REVIEW_EXTRA_ALLOWED_TOOLS) || '' }}"
|
|
178
|
+
--disallowedTools "Bash,Edit,Write,NotebookEdit,AskUserQuestion,Agent,WebFetch,WebSearch"
|
|
179
|
+
|
|
180
|
+
# The dist-tag after the package name decides the version. @latest is the newest release,
|
|
181
|
+
# and a new major version brings breaking changes. Use @<major> or @<version> to stay on one.
|
|
182
|
+
# --prefix=/ keeps npx from stopping in a repository that declares pnpm devEngines.
|
|
183
|
+
- name: Finish
|
|
184
|
+
if: ${{ always() }}
|
|
185
|
+
env:
|
|
186
|
+
PR: ${{ github.event.pull_request.number || github.event.issue.number }}
|
|
187
|
+
JOB_STATUS: ${{ job.status }}
|
|
188
|
+
REVIEW_OUTCOME: ${{ steps.claude.outcome }}
|
|
189
|
+
REVIEW_CONCLUSION: ${{ steps.claude.outputs.conclusion }}
|
|
190
|
+
# Pass only whether the action got a token, never the token itself.
|
|
191
|
+
REVIEW_HAS_TOKEN: ${{ steps.claude.outputs.github_token != '' }}
|
|
192
|
+
PECOT_GITHUB_COM_TOKEN: ${{ steps.token.outputs.token || github.token }}
|
|
193
|
+
run: >-
|
|
194
|
+
npx -y --prefix=/ @pecot/workflow-mcp@latest pr review-finish "$GITHUB_REPOSITORY/$PR" --ensure
|
|
195
|
+
--job-status "$JOB_STATUS" --review-outcome "$REVIEW_OUTCOME"
|
|
196
|
+
--review-conclusion "$REVIEW_CONCLUSION" --review-has-token "$REVIEW_HAS_TOKEN"
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pecot/workflow-mcp",
|
|
3
|
-
"version": "8.0.1-dev.
|
|
3
|
+
"version": "8.0.1-dev.57",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@pecot/workflow-mcp",
|
|
9
|
-
"version": "8.0.1-dev.
|
|
9
|
+
"version": "8.0.1-dev.57",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@modelcontextprotocol/server": "^2.4.0",
|