Skip to content

Commit 35af14c

Browse files
committed
Make PULUMI_BOT_TOKEN and CODECOV_TOKEN optional
Community contributors don't have access to either of these tokens and we don't *need* them to run tests for them, so we make them optional. This should enable Pulumi Org members to approve CI runs for contributors. Fixes #2179
1 parent 99938e1 commit 35af14c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/build-and-test.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ on:
55
inputs: {}
66
secrets:
77
CODECOV_TOKEN:
8-
required: true
9-
PULUMI_BOT_TOKEN:
10-
required: true
8+
required: false
119
env:
12-
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1311

1412
jobs:
1513
test:
@@ -47,6 +45,11 @@ jobs:
4745
- name: Test Dynamic
4846
run: cd dynamic && make test
4947
- name: Upload coverage reports to Codecov
48+
# If we have a CODECOV_TOKEN secret, then we upload it to get a coverage report.
49+
#
50+
# Community contributors do not have access to the CODECOV_TOKEN, so we just skip
51+
# this step.
52+
if: ${{ env.CODECOV_TOKEN != '' }}
5053
uses: codecov/codecov-action@v4
5154
env:
5255
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
env:
2-
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
2+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33

44
name: Pull Request
55

0 commit comments

Comments
 (0)