Skip to content

Commit aa4513a

Browse files
committed
fix(scripts/ci-after-success): GITHUB_REF doesn't have a leading slash
1 parent a084872 commit aa4513a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/scripts/__tests__/ci-after-success.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ cases(
2121
},
2222
}) => {
2323
// beforeEach
24-
2524
const {sync: crossSpawnSyncMock} = require('cross-spawn')
2625
const utils = require('../../utils')
2726
utils.resolveBin = (modName, {executable = modName} = {}) => executable
27+
2828
const originalEnvs = Object.keys(env).map(envKey => {
2929
const orig = process.env[envKey]
3030
process.env[envKey] = env[envKey]
@@ -82,7 +82,8 @@ cases(
8282
},
8383
'calls concurrently with both scripts when on github actions': {
8484
env: {
85-
GITHUB_REF: '/refs/heads/main',
85+
CF_BRANCH: '',
86+
GITHUB_REF: 'refs/heads/main',
8687
TRAVIS_PULL_REQUEST: 'false',
8788
},
8889
},

src/scripts/ci-after-success.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const releaseBranches = [
2323
'beta',
2424
'alpha',
2525
]
26-
const branch = CF_BRANCH || TRAVIS_BRANCH || GITHUB_REF.replace(/\/refs\/.*\//)
26+
const branch =
27+
CF_BRANCH || TRAVIS_BRANCH || GITHUB_REF.replace(/refs\/.*\//, '')
2728
const isCI = parseEnv('TRAVIS', false) || parseEnv('CI', false)
2829

2930
const codecovCommand = `echo installing codecov && npx -p codecov@3 -c 'echo running codecov && codecov'`

0 commit comments

Comments
 (0)