.github/workflows/coverity-scan.yml: set secret token env var at job level

This stops the job from being run if the secret is not available,
i.e. forks without a coverity token.
This commit is contained in:
Duncan Overbruck 2022-01-25 15:03:15 +01:00
parent c9e47b6cd9
commit 2a4028f093
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35

View File

@ -6,7 +6,10 @@ on:
jobs: jobs:
latest: latest:
if: github.repository == 'void-linux/xbps'
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
steps: steps:
- name: Setup container - name: Setup container
@ -21,8 +24,6 @@ jobs:
wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=void-linux%2Fxbps" -O cov-analysis-linux64.tar.gz wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=void-linux%2Fxbps" -O cov-analysis-linux64.tar.gz
mkdir cov-analysis-linux64 mkdir cov-analysis-linux64
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
- name: Configure and build in voidlinux/voilinux container - name: Configure and build in voidlinux/voilinux container
run: | run: |
@ -44,5 +45,3 @@ jobs:
--form version=trunk \ --form version=trunk \
--form description="github action coverity scan" \ --form description="github action coverity scan" \
https://scan.coverity.com/builds?project=void-linux%2Fxbps https://scan.coverity.com/builds?project=void-linux%2Fxbps
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}