Skip to content

Commit

Permalink
Add snyk workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ymengesha committed Jul 7, 2023
1 parent fc533a0 commit adffa2e
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/snyk-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run Snyk scan on PRs

on:
pull_request:
branches:
- master**

jobs:
scan-for-new-issues:
runs-on: ubuntu-latest

steps:
- uses: hivemq/hivemq-checkout-composite-action@v1
with:
path: mqtt-cli

- name: Check for new issues
uses: hivemq/hivemq-snyk-composite-action@v1
with:
snyk-args: --configuration-matching=^runtimeClasspath$ -d mqtt-cli
snyk-token: ${{ secrets.SNYK_TOKEN }}
github-username: ${{ secrets.PUBLISH_GITHUB_USERNAME }}
github-token: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/snyk-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run Snyk monitor on push

on:
push:
branches:
- master**

jobs:
run-snyk-monitor:
runs-on: ubuntu-latest

steps:
- uses: hivemq/hivemq-checkout-composite-action@v1
with:
path: mqtt-cli

- name: Run Snyk monitor
uses: snyk/actions/gradle-jdk11@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
ORG_GRADLE_PROJECT_hivemqCommonsUsername: ${{ secrets.PUBLISH_GITHUB_USERNAME }}
ORG_GRADLE_PROJECT_hivemqCommonsPassword: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
with:
command: monitor
args: --all-sub-projects --configuration-matching=^runtimeClasspath$ --target-reference=${{ github.ref_name }} -d mqtt-cli
25 changes: 25 additions & 0 deletions .github/workflows/snyk-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run Snyk monitor on releases

on:
release:
types: [ published ]

jobs:
run-snyk-monitor:
runs-on: ubuntu-latest
environment: snyk-monitor-releases

steps:
- uses: hivemq/hivemq-checkout-composite-action@v1
with:
path: mqtt-cli

- name: Run Snyk monitor
uses: snyk/actions/gradle-jdk11@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
ORG_GRADLE_PROJECT_hivemqCommonsUsername: ${{ secrets.PUBLISH_GITHUB_USERNAME }}
ORG_GRADLE_PROJECT_hivemqCommonsPassword: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
with:
command: monitor
args: --all-sub-projects --configuration-matching=^runtimeClasspath$ --target-reference=${{ github.ref_name }} -d mqtt-cli

0 comments on commit adffa2e

Please sign in to comment.