Skip to content

Commit ad881fe

Browse files
runningcodeclaude
andauthored
fix(ci): Configure Sentry headRef in build config instead of workflow (#665)
## Summary - Remove `GITHUB_HEAD_REF` environment variable hack from the Android release workflow - Configure Sentry Gradle plugin's `vcsInfo.headRef` parameter to detect release workflows using `GITHUB_EVENT_NAME` This moves the configuration from the workflow to the proper location in the build configuration, making it more maintainable and following the intended plugin architecture. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent 593bd14 commit ad881fe

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/android_release_build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ jobs:
4545
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_KEY }}
4646
REAPER_API_KEY: ${{ secrets.REAPER_API_KEY }}
4747
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }}
48-
# Hack to ensure head-ref is set to avoid failing uploading to Sentry
49-
GITHUB_HEAD_REF: release
5048
run: ./gradlew :app:bundlePlayStoreRelease
5149

5250
- name: Convert AAB to APK

android/app/build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ sentry {
128128
updateSdkVariants.add("beta")
129129
}
130130

131+
vcsInfo {
132+
// Set headRef to "release" when running in GitHub release workflow
133+
val eventName = providers.environmentVariable("GITHUB_EVENT_NAME").orNull
134+
if (eventName == "release") {
135+
headRef.set("release")
136+
}
137+
}
138+
131139
debug = true
132140
}
133141

0 commit comments

Comments
 (0)