1414 types : [created]
1515
1616jobs :
17- # ──────────────────────────────────────────────
18- # Job 1: Automated review on PR open or new push
19- # ──────────────────────────────────────────────
2017 doc-review :
2118 if : github.event_name == 'pull_request'
2219 runs-on : ubuntu-latest
5956 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6057 run : |
6158 PR_NUMBER=${{ github.event.pull_request.number }}
62- # Find and delete previous doc-pr review comments from the bot
6359 COMMENT_IDS=$(gh api repos/${{ github.repository }}/issues/${PR_NUMBER}/comments \
6460 --jq '[.[] | select(.user.login == "github-actions[bot]" and (.body | contains("Documentation PR Review"))) | .id] | .[]' 2>/dev/null || true)
6561 for ID in $COMMENT_IDS; do
@@ -79,48 +75,16 @@ jobs:
7975 with :
8076 anthropic_api_key : ${{ secrets.ANTHROPIC_API_KEY }}
8177 github_token : ${{ secrets.GITHUB_TOKEN }}
82- show_full_output : true
8378 prompt : |
84- Run the doc-pr review skill on this pull request.
85-
79+ Call the doc-pr review skill:
8680 /doc-pr ${{ steps.changed-files.outputs.files }} ${{ github.event.pull_request.number }}
87- claude_args : |
88- --model claude-sonnet-4-5-20250929
89- --allowedTools "Read,Write,Glob,Grep,Bash(vale:*),Bash(gh pr view:*),Bash(gh pr diff:*),Skill(doc-pr),Skill(dale)"
90-
91- - name : Post review comment
92- if : steps.changed-files.outputs.count > 0
93- env :
94- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
95- PR_NUMBER : ${{ github.event.pull_request.number }}
96- REPO : ${{ github.repository }}
97- run : |
98- REVIEW_FILE=".doc-pr-review.md"
99- FOOTER=$'\n\n---\n\n'
100- FOOTER+=$'**What to do next:**\n\n'
101- FOOTER+=$'Comment `@claude` on this PR followed by your instructions to get help:\n\n'
102- FOOTER+=$'- `@claude fix all issues` — fix all Vale, Dale, and editorial issues\n'
103- FOOTER+=$'- `@claude fix only the Vale issues` — fix just the linting problems\n'
104- FOOTER+=$'- `@claude help improve the flow of this document` — get writing assistance\n'
105- FOOTER+=$'- `@claude explain the voice issues` — understand why something was flagged\n\n'
106- FOOTER+=$'You can ask Claude anything about the review or about Netwrix writing standards.\n\n'
107- FOOTER+=$'> Automated fixes are only available for branches in this repository, not forks.'
108-
109- if [ -f "$REVIEW_FILE" ]; then
110- BODY=$(cat "$REVIEW_FILE")
111- else
112- BODY="## Documentation PR Review"$'\n\n'"No review was generated. Check the workflow logs for details."
113- fi
114-
115- # Append footer
116- FULL_BODY="${BODY}${FOOTER}"
11781
118- # Post as PR comment
119- gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$FULL_BODY"
82+ Context:
83+ - REPO: ${{ github.repository }}
84+ - PR_NUMBER: ${{ github.event.pull_request.number }}
85+ - CHANGED_FILES: ${{ steps.changed-files.outputs.files }}
86+ claude_args : ' --allowedTools "Bash(vale:*),Bash(gh:*),Read,Glob,Grep,Skill(doc-pr),Skill(dale)"'
12087
121- # ──────────────────────────────────────────────
122- # Job 2: @claude follow-up on PR comments
123- # ──────────────────────────────────────────────
12488 doc-followup :
12589 if : >-
12690 github.event_name == 'issue_comment' &&
@@ -144,9 +108,8 @@ jobs:
144108 BASE_BRANCH=$(echo "$PR_DATA" | jq -r '.baseRefName')
145109 echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
146110 echo "branch=$(echo "$PR_DATA" | jq -r '.headRefName')" >> "$GITHUB_OUTPUT"
147- echo "base_branch=$BASE_BRANCH" >> "$GITHUB_OUTPUT"
148111 echo "is_fork=$(echo "$PR_DATA" | jq -r '.isCrossRepository')" >> "$GITHUB_OUTPUT"
149- # Check target branch here using the shell variable to avoid
112+ # Check target branch using the shell variable to avoid
150113 # re-interpolating the output via expressions (code injection risk).
151114 if [ "$BASE_BRANCH" = "dev" ]; then
152115 echo "targets_dev=true" >> "$GITHUB_OUTPUT"
@@ -184,9 +147,6 @@ jobs:
184147 with :
185148 anthropic_api_key : ${{ secrets.ANTHROPIC_API_KEY }}
186149 github_token : ${{ secrets.GITHUB_TOKEN }}
187- show_full_output : true
188150 prompt : |
189151 /doc-pr-fix ${{ steps.pr-info.outputs.number }} $COMMENT_BODY
190- claude_args : |
191- --model claude-sonnet-4-5-20250929
192- --allowedTools "Read,Write,Edit,Glob,Grep,Bash(vale:*),Bash(gh api:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr comment:*),Bash(git config:*),Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git status:*),Bash(git diff:*),Skill(doc-pr-fix),Skill(dale)"
152+ claude_args : ' --allowedTools "Bash(vale:*),Bash(gh:*),Bash(git:*),Read,Write,Edit,Glob,Grep,Skill(doc-pr-fix),Skill(dale)"'
0 commit comments