Skip to content

Commit 48ca1ed

Browse files
justinmk3laileni-aws
authored andcommitted
ci: codecov doesn't run in Github Actions
Problem: Codecov doesn't run in Github Actions. This is because: - The `github.ref == 'master'` condition is incorrect. We want the _target_ branch, not the source branch. - The `|| github.event_name == 'pull_request'` condition was removed in 034257e. Solution: Fix the condition. Note that `github.base_ref` is only defined for pull requests, so we require `github.event_name == 'pull_request'`.
1 parent 3c08bfa commit 48ca1ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/node.js.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
env:
8585
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
8686
NODE_OPTIONS: ''
87-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
87+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.event_name == 'pull_request' && github.base_ref == 'master' }}
8888
uses: codecov/codecov-action@v5
8989
with:
9090
flags: macos-toolkit-unittests
@@ -95,7 +95,7 @@ jobs:
9595
env:
9696
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
9797
NODE_OPTIONS: ''
98-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
98+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.event_name == 'pull_request' && github.base_ref == 'master' }}
9999
uses: codecov/codecov-action@v5
100100
with:
101101
flags: macos-amazonq-unittests
@@ -154,7 +154,7 @@ jobs:
154154
env:
155155
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
156156
NODE_OPTIONS: ''
157-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
157+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.event_name == 'pull_request' && github.base_ref == 'master' }}
158158
uses: codecov/codecov-action@v5
159159
with:
160160
flags: windows-unittests

0 commit comments

Comments
 (0)