Skip to content

Commit

Permalink
github: only run the coverity workflow on our repository
Browse files Browse the repository at this point in the history
Also, build a version ID based on the latest tag + commit so we can
easily identify what revision was scanned.
  • Loading branch information
daniloegea committed Aug 14, 2023
1 parent 78ab30f commit 397288f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
coverity:
if: github.repository == 'canonical/netplan'
runs-on: ubuntu-22.04

steps:
Expand All @@ -29,4 +30,7 @@ jobs:
tar czf netplan.tar.gz cov-int
- name: Upload results
run: |
curl --form token=${{ secrets.COVERITY_TOKEN }} --form email=${{ secrets.COVERITY_EMAIL }} --form [email protected] --form version="0.106" --form description="Coverity scan" https://scan.coverity.com/builds?project=Netplan
TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) # find latest (stable) tag
REV=$(git rev-parse --short HEAD) # get current git revision
VER="$TAG+git~$REV"
curl --form token=${{ secrets.COVERITY_TOKEN }} --form email=${{ secrets.COVERITY_EMAIL }} --form [email protected] --form version="${VER}" --form description="Coverity scan" https://scan.coverity.com/builds?project=Netplan

0 comments on commit 397288f

Please sign in to comment.