Skip to content

Commit eb563eb

Browse files
authored
ci: use GITHUB_TOKEN in binding server's tests (#2258)
See #2253 (comment) It's needed because if CI runs from a contributor's fork, they don't have GitHub App-specific secrets configured. They, however, do have some default GITHUB_TOKEN. The downside of this change is that we won't test GitHub App integration in CI.
1 parent d111415 commit eb563eb

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/bindings-server.main.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import kotlin.time.TimeSource
3131

3232
val DOCKERHUB_USERNAME by Contexts.secrets
3333
val DOCKERHUB_PASSWORD by Contexts.secrets
34+
val GITHUB_TOKEN by Contexts.secrets
3435
val APP_PRIVATE_KEY by Contexts.secrets
3536

3637
@OptIn(ExperimentalKotlinLogicStep::class)
@@ -53,6 +54,12 @@ workflow(
5354
name = "End-to-end test",
5455
runsOn = UbuntuLatest,
5556
env = mapOf(
57+
// Should be in every repo, even forks.
58+
"GITHUB_TOKEN" to expr { GITHUB_TOKEN },
59+
// Configured only in the parent repo in "typesafegithub" org.
60+
// The logic should first try to use GitHub App-based auth,
61+
// and fall back to GITHUB_TOKEN-based. This way, we test
62+
// GitHub App-based integration at least in the parent repo.
5663
"APP_PRIVATE_KEY" to expr { APP_PRIVATE_KEY },
5764
"APP_INSTALLATION_ID" to "62885502",
5865
"APP_CLIENT_ID" to "Iv23liIZ17VJKUpjacBs",

.github/workflows/bindings-server.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
needs:
4949
- 'check_yaml_consistency'
5050
env:
51+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
5152
APP_PRIVATE_KEY: '${{ secrets.APP_PRIVATE_KEY }}'
5253
APP_INSTALLATION_ID: '62885502'
5354
APP_CLIENT_ID: 'Iv23liIZ17VJKUpjacBs'

0 commit comments

Comments
 (0)