Skip to content

Commit 537cb67

Browse files
authored
ci(test): use environment variables over shell evaluation when reporting coverage (#3088)
1 parent fafe224 commit 537cb67

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,8 @@ jobs:
277277
name: tests-coverage-cache-${{ github.run_number }}-24
278278
path: .
279279
- name: Report Coverage with Flags
280-
run: node ./scripts/codecov-upload-flags.mjs ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.head.label }}
280+
run: node ./scripts/codecov-upload-flags.mjs
281+
env:
282+
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
283+
PR_BRANCH_NAME: ${{ github.event.pull_request.head.label }}
281284

scripts/codecov-upload-flags.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import path from 'path';
66
// Usage
77
// node ./scripts/codecov-upload-flags.mjs
88

9-
const commitSha = process.argv[2];
10-
const branchName = process.argv[3];
9+
const commitSha = process.env.COMMIT_SHA;
10+
const branchName = process.env.PR_BRANCH_NAME;
1111

1212
const readPkg = (dir) => JSON.parse(readFileSync(path.join(dir, 'package.json'), 'utf8'));
1313
const pkgInfo = readPkg('.');

0 commit comments

Comments
 (0)