Commit 37b30d4
authored
ci: handle fork PRs in SKILL.md auto-commit (#227)
## Summary
Fixes a bug introduced in #224 where the `check-skill` CI job would fail
for fork PRs.
## Problem
The auto-commit flow for stale SKILL.md uses a GitHub App token
(`SENTRY_RELEASE_BOT`) to push commits back to the branch. This fails
for fork PRs because:
1. **Secrets are unavailable** — GitHub does not expose repo secrets to
`pull_request` workflows triggered from forks (security policy)
2. **No push access** — Even if the token were available, the GitHub App
is installed on `getsentry/cli`, not the contributor's fork
## Fix
- **Skip the token step** for fork PRs (conditional on
`github.event.pull_request.head.repo.full_name == github.repository`)
- **Fall back to `github.token`** for checkout when the app token isn't
available
- **Auto-commit** only when the app token was successfully obtained
(same-repo PRs and push events)
- **Fail with an actionable error** for fork PRs, asking the contributor
to run `bun run generate:skill` locally1 parent 213f68f commit 37b30d4
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
72 | | - | |
73 | | - | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
| |||
0 commit comments