You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(build): Set head-ref in non-PR GitHub workflows (EME-654) (#2976)
## Summary
- Extends `get_github_head_ref()` to support non-PR GitHub Actions
workflows
- For PR workflows: continues to use `GITHUB_HEAD_REF` (unchanged)
- For non-PR workflows (push, release, etc.): now uses `GITHUB_REF_NAME`
- Adds comprehensive tests for all workflow types
## Changes
Modified `src/utils/vcs.rs`:
- Updated `get_github_head_ref()` to handle non-PR events by reading
`GITHUB_REF_NAME`
- Added test coverage for push workflows, feature branches, tags, and
edge cases
## Impact
Build uploads in non-PR workflows (like Android release builds) will now
automatically have the correct branch or tag reference set, without
requiring manual `--head-ref` flags.
Fixes EME-654
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
# Changelog
2
2
3
+
## Unreleased
4
+
5
+
### Improvements
6
+
7
+
- The `sentry-cli build upload` command now automatically detects the correct branch or tag reference in non-PR GitHub Actions workflows ([#2976](https://github.com/getsentry/sentry-cli/pull/2976)). Previously, `--head-ref` was only auto-detected for pull request workflows. Now it works for push, release, and other workflow types by using the `GITHUB_REF_NAME` environment variable.
0 commit comments