Skip to content

Commit 1ab034e

Browse files
dingsdaxclaude
andcommitted
fix(ci): Fix workflow trigger overlap and shallow clone issues
Make docs-codebase-refresh manual-only (workflow_dispatch) to avoid competing PRs when both workflows fire on the same push. Switch incremental update from git diff to GitHub compare API to handle multi-commit pushes and shallow clone environments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5611640 commit 1ab034e

File tree

4 files changed

+26
-47
lines changed

4 files changed

+26
-47
lines changed

.github/workflows/docs-codebase-refresh.lock.yml

Lines changed: 5 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/docs-codebase-refresh.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
22
name: docs-codebase-refresh
3-
description: Full refresh of SDK codebase documentation on merge or manual trigger
3+
description: Full refresh of SDK codebase documentation (manual trigger only)
44
on:
5-
push:
6-
branches: [main, master]
75
workflow_dispatch:
86
permissions:
97
contents: read

.github/workflows/docs-codebase-update.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,22 @@ only the codebase pages affected by the latest code changes.
4141

4242
### Step 1: Identify Changed Files
4343

44-
Run `git diff HEAD~1 --name-only` to get the list of changed files in the
45-
latest commit. Filter to files matching the trigger paths:
44+
Use the GitHub API to get the list of changed files for the push event.
45+
Do NOT use `git diff` -- the checkout is a shallow clone without full history.
46+
47+
Use the compare API with the push event's `before` and `after` SHAs:
48+
49+
```bash
50+
gh api repos/{owner}/{repo}/compare/{before}...{after} --jq '.files[].filename'
51+
```
52+
53+
If `before` is the zero SHA (new branch), compare against the default branch:
54+
55+
```bash
56+
gh api repos/{owner}/{repo}/compare/{default_branch}...{after} --jq '.files[].filename'
57+
```
58+
59+
Filter the resulting file list to paths matching the trigger paths:
4660
- `sentry_sdk/**`
4761
- `MIGRATION_GUIDE.md`
4862
- `CHANGELOG.md`

docs/codebase/BUILD_PLAN.md

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)