Skip to content

Commit a60d9b7

Browse files
committed
CI: Submit coverage to codecov via pinned PyPI pkg
Following a security incident at Codecov, the GitHub action should be considered unsafe as it internally runs `curl | bash`. Moving to our CI scripts.
1 parent cb110b0 commit a60d9b7

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

.github/workflows/misc.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ jobs:
5151
- name: Run tests
5252
run: tools/ci/check.sh
5353
if: ${{ matrix.check != 'skiptests' }}
54-
- uses: codecov/codecov-action@v1
55-
with:
56-
file: for_testing/coverage.xml
54+
- name: Submit coverage
55+
run: tools/ci/submit_coverage.sh
5756
if: ${{ always() }}
5857
- name: Upload pytest test results
5958
uses: actions/upload-artifact@v2

.github/workflows/pre-release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ jobs:
7474
- name: Run tests
7575
run: tools/ci/check.sh
7676
if: ${{ matrix.check != 'skiptests' }}
77-
- uses: codecov/codecov-action@v1
78-
with:
79-
file: for_testing/coverage.xml
77+
- name: Submit coverage
78+
run: tools/ci/submit_coverage.sh
8079
if: ${{ always() }}
8180
- name: Upload pytest test results
8281
uses: actions/upload-artifact@v2

.github/workflows/stable.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ jobs:
117117
- name: Run tests
118118
run: tools/ci/check.sh
119119
if: ${{ matrix.check != 'skiptests' }}
120-
- uses: codecov/codecov-action@v1
121-
with:
122-
file: for_testing/coverage.xml
120+
- name: Submit coverage
121+
run: tools/ci/submit_coverage.sh
123122
if: ${{ always() }}
124123
- name: Upload pytest test results
125124
uses: actions/upload-artifact@v2

tools/ci/submit_coverage.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
echo Submitting coverage
4+
5+
source tools/ci/activate.sh
6+
7+
set -eu
8+
9+
set -x
10+
11+
COVERAGE_FILE="for_testing/coverage.xml"
12+
13+
if [ -e "$COVERAGE_FILE" ]; then
14+
# Pin codecov version to reduce scope for malicious updates
15+
python -m pip install "codecov==2.1.11"
16+
python -m codecov --file for_testing/coverage.xml
17+
fi
18+
19+
set +eux
20+
21+
echo Done submitting coverage

0 commit comments

Comments
 (0)