Commit 848fe45
chore(ci): strip GitHub Actions env vars in backfill-release-notes (#5324)
Fix the backfill-release-notes script to correctly detect the git branch
when running semantic-release in dry-run mode.
The script was passing the full process environment to semantic-release,
which includes GitHub Actions detection variables (GITHUB_REF,
GITHUB_ACTIONS, etc.). The semantic-release library uses env-ci to
detect the current branch, and env-ci prioritizes these CI environment
variables over the actual git HEAD state. This caused env-ci to report
the wrong branch when backfilling from a workflow that ran on a
different branch than the current clone's HEAD, leading to
semantic-release errors about local branches being behind remote.
**Key changes:**
- Create a filtered child environment that strips GitHub Actions
detection variables (GITHUB_ACTIONS, GITHUB_REF, GITHUB_REF_NAME,
GITHUB_HEAD_REF, GITHUB_BASE_REF, GITHUB_EVENT_NAME, CI)
- Pass the filtered environment to semantic-release instead of the full
process environment
- This allows env-ci to fall back to reading the branch from git HEAD in
the clone, which is the correct source of truth for the backfill
operation
https://claude.ai/code/session_01QQsjHNdZTJHhLWr2FYSjhe
Co-authored-by: Claude <noreply@anthropic.com>1 parent bc0600d commit 848fe45
1 file changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
178 | 199 | | |
179 | 200 | | |
180 | 201 | | |
181 | 202 | | |
182 | | - | |
| 203 | + | |
183 | 204 | | |
184 | 205 | | |
185 | 206 | | |
| |||
0 commit comments