Update Snyk Workflow to target other branches (#20601)
Closes #20364 Co-authored-by: Stian Thorgersen <stianst@gmail.com>
This commit is contained in:
parent
f3c393f53e
commit
9193e2e09e
2 changed files with 26 additions and 3 deletions
25
.github/workflows/schedule.yml
vendored
Normal file
25
.github/workflows/schedule.yml
vendored
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
name: Scheduled workflows
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
run-ci:
|
||||||
|
name: Run CI workflow
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Run Snyk with main branch
|
||||||
|
run: gh workflow run -R keycloak/keycloak snyk-analysis.yml -r main
|
||||||
|
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Run Snyk with latest release branch
|
||||||
|
run: |
|
||||||
|
patch_release=$(gh api repos/keycloak/keycloak/branches | jq -r '.[].name' | sort -r | awk -F'/' '/[0-9.]+$/ {print $NF; exit}')
|
||||||
|
gh workflow run -R keycloak/keycloak snyk-analysis.yml -r "release/$patch_release"
|
||||||
|
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
4
.github/workflows/snyk-analysis.yml
vendored
4
.github/workflows/snyk-analysis.yml
vendored
|
@ -1,8 +1,6 @@
|
||||||
name: Snyk
|
name: Snyk
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
|
||||||
- cron: 0 0 * * *
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
|
|
Loading…
Reference in a new issue