Skip to content

Commit 87a3ae2

Browse files
authored
Merge pull request #450 from netwrix/dev
use gh pr diff instead of git diff for changed files
2 parents 641bbcc + 8c40335 commit 87a3ae2

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

.github/workflows/claude-doc-pr.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@ jobs:
2727
uses: actions/checkout@v4
2828
with:
2929
ref: ${{ github.event.pull_request.head.sha }}
30-
fetch-depth: 1
31-
32-
- name: Fetch base commit for diff
33-
run: git fetch --depth=1 origin ${{ github.event.pull_request.base.sha }}
3430

3531
- name: Get changed markdown files
3632
id: changed-files
33+
env:
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3735
run: |
38-
BASE_SHA="${{ github.event.pull_request.base.sha }}"
39-
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
40-
CHANGED_MD_FILES=$(git diff --name-only --diff-filter=ACMRT $BASE_SHA $HEAD_SHA -- 'docs/*.md' 'docs/**/*.md' | grep -v '/CLAUDE\.md$' | grep -v '/SKILL\.md$' || true)
36+
PR_NUMBER=${{ github.event.pull_request.number }}
37+
CHANGED_MD_FILES=$(gh pr diff "$PR_NUMBER" --name-only | grep -E '^docs/.*\.md$' | grep -v '/CLAUDE\.md$' | grep -v '/SKILL\.md$' || true)
4138
if [ -z "$CHANGED_MD_FILES" ]; then
4239
echo "No docs markdown files changed"
4340
echo "files=" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)