Skip to content

Commit e084cde

Browse files
committed
Revert "Do not pass secrets to environment variables"
This reverts commit 9bacb77. > Secrets cannot be directly referenced in `if:` conditionals https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-secrets The rest of the documentation explains how to pass secrets to environment variables… ¯\_(ツ)_/¯
1 parent 9bacb77 commit e084cde

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
version: ${{ steps.dotnet-pack.outputs.version }}
2727
nupkg-filename: ${{ steps.dotnet-pack.outputs.nupkg-filename }}
2828
release-body: ${{ steps.tag-message.outputs.release-notes }}
29+
env:
30+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
31+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
2932
steps:
3033
- name: Checkout git repository
3134
uses: actions/checkout@v3
@@ -72,7 +75,7 @@ jobs:
7275
with:
7376
files: ${{ steps.dotnet-test.outputs.coverage-reports }}
7477
- name: Upload coverage report to Codacy
75-
if: matrix.os == 'ubuntu-latest' && secrets.CODACY_PROJECT_TOKEN != ''
78+
if: matrix.os == 'ubuntu-latest' && env.CODACY_PROJECT_TOKEN != ''
7679
uses: codacy/codacy-coverage-reporter-action@v1
7780
with:
7881
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
@@ -87,7 +90,7 @@ jobs:
8790
name: ${{ steps.dotnet-pack.outputs.nupkg-filename }}
8891
path: ${{ steps.dotnet-pack.outputs.nupkg-filename }}
8992
- name: Run mutation tests and upload report to Stryker dashboard
90-
if: matrix.os == 'ubuntu-latest' && secrets.STRYKER_DASHBOARD_API_KEY != ''
93+
if: matrix.os == 'ubuntu-latest' && env.STRYKER_DASHBOARD_API_KEY != ''
9194
run: |
9295
dotnet tool restore
9396
dotnet tool run dotnet-stryker --reporter dashboard --version ${GITHUB_REF_NAME} --dashboard-api-key ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

0 commit comments

Comments
 (0)