Skip to content

Commit cbf1eac

Browse files
authored
fix(ci): warn instead of fail on missing turbo env vars for forks (#8168)
1 parent 118999c commit cbf1eac

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

.changeset/warm-turbo-forks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/actions/init-blacksmith/action.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ inputs:
2626
required: false
2727
turbo-team:
2828
description: 'The team to use for Turbo remote auth'
29-
required: true
29+
required: false
3030
turbo-token:
3131
description: 'The token to use for Turbo remote auth'
32-
required: true
32+
required: false
3333
registry-url:
3434
description: 'The registry the packages will be published to'
3535
required: false
@@ -82,15 +82,17 @@ runs:
8282
)
8383
8484
if (ENABLED === 'true') {
85-
if (!TEAM) {
86-
throw new Error('turbo-team input is required and must not be empty')
87-
}
88-
if (!TOKEN) {
89-
throw new Error('turbo-token input is required and must not be empty')
85+
const missing = []
86+
if (!TEAM) missing.push('turbo-team')
87+
if (!TOKEN) missing.push('turbo-token')
88+
89+
if (missing.length > 0) {
90+
core.warning(`Missing Turbo remote cache credentials: ${missing.join(', ')}. Turbo remote caching will be disabled.`)
91+
} else {
92+
core.exportVariable('TURBO_CACHE', CACHE)
93+
core.exportVariable('TURBO_TEAM', TEAM)
94+
core.exportVariable('TURBO_TOKEN', TOKEN)
9095
}
91-
core.exportVariable('TURBO_CACHE', CACHE)
92-
core.exportVariable('TURBO_TEAM', TEAM)
93-
core.exportVariable('TURBO_TOKEN', TOKEN)
9496
}
9597
9698
if (SIGNATURE && SIGNATURE !== '') {

.github/actions/init/action.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ inputs:
2626
required: false
2727
turbo-team:
2828
description: 'The team to use for Turbo remote auth'
29-
required: true
29+
required: false
3030
turbo-token:
3131
description: 'The token to use for Turbo remote auth'
32-
required: true
32+
required: false
3333
registry-url:
3434
description: 'The registry the packages will be published to'
3535
required: false
@@ -82,15 +82,17 @@ runs:
8282
)
8383
8484
if (ENABLED === 'true') {
85-
if (!TEAM) {
86-
throw new Error('turbo-team input is required and must not be empty')
87-
}
88-
if (!TOKEN) {
89-
throw new Error('turbo-token input is required and must not be empty')
85+
const missing = []
86+
if (!TEAM) missing.push('turbo-team')
87+
if (!TOKEN) missing.push('turbo-token')
88+
89+
if (missing.length > 0) {
90+
core.warning(`Missing Turbo remote cache credentials: ${missing.join(', ')}. Turbo remote caching will be disabled.`)
91+
} else {
92+
core.exportVariable('TURBO_CACHE', CACHE)
93+
core.exportVariable('TURBO_TEAM', TEAM)
94+
core.exportVariable('TURBO_TOKEN', TOKEN)
9095
}
91-
core.exportVariable('TURBO_CACHE', CACHE)
92-
core.exportVariable('TURBO_TEAM', TEAM)
93-
core.exportVariable('TURBO_TOKEN', TOKEN)
9496
}
9597
9698
if (SIGNATURE && SIGNATURE !== '') {

0 commit comments

Comments
 (0)