Skip to content

Commit 2463f36

Browse files
authored
Merge pull request #1166 from tailor-platform/fix/dup-docs-check
2 parents 6c3a2cb + 2e4254d commit 2463f36

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/docs-consistency-check.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Docs Implementation Consistency Check
22

33
on:
44
pull_request:
5-
types: [ready_for_review, review_requested]
5+
types: [ready_for_review, labeled]
66
paths:
77
- "packages/sdk/src/**"
88
- "packages/sdk/docs/**"
@@ -16,8 +16,13 @@ permissions:
1616

1717
jobs:
1818
docs-consistency:
19+
if: >
20+
github.event.action == 'ready_for_review'
21+
|| (github.event.action == 'labeled' && github.event.label.name == 'docs-check')
1922
runs-on: ubuntu-slim
2023
timeout-minutes: 10
24+
env:
25+
PR_NUMBER: ${{ github.event.number }}
2126
steps:
2227
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2328
with:
@@ -46,8 +51,8 @@ jobs:
4651
### 1. Retrieve PR Changes
4752
4853
```bash
49-
gh pr view ${{ github.event.number }} --json title,body,files
50-
gh pr diff ${{ github.event.number }}
54+
gh pr view ${{ env.PR_NUMBER }} --json title,body,files
55+
gh pr diff ${{ env.PR_NUMBER }}
5156
```
5257
5358
### 2. Classify Changes
@@ -88,7 +93,7 @@ jobs:
8893
Search for an existing comment and update it, or create a new one.
8994
9095
```bash
91-
COMMENT_ID=$(gh api repos/${{ github.repository }}/issues/${{ github.event.number }}/comments \
96+
COMMENT_ID=$(gh api repos/${{ github.repository }}/issues/${{ env.PR_NUMBER }}/comments \
9297
--jq '.[] | select(.body | contains("<!-- docs-consistency-check -->")) | .id' | head -n 1)
9398
```
9499
@@ -141,3 +146,9 @@ jobs:
141146
claude_args: |
142147
--model claude-sonnet-4-5-20250929
143148
--allowedTools "Bash(gh pr:*),Bash(gh api:*),Read,Glob,Grep"
149+
150+
- name: Remove trigger label
151+
if: always() && github.event.action == 'labeled' && github.event.label.name == 'docs-check'
152+
env:
153+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154+
run: gh pr edit "$PR_NUMBER" --repo "${{ github.repository }}" --remove-label docs-check

0 commit comments

Comments
 (0)