Keycloak
1name: Scheduled nightly workflows2
3on:4schedule:5- cron: '0 0 * * *'6workflow_dispatch:7
8jobs:9
10setup:11if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'12runs-on: ubuntu-latest13outputs:14latest-release-branch: ${{ steps.latest-release.outputs.branch }}15steps:16- id: latest-release17run: |18branch="release/$(gh api repos/keycloak/keycloak/branches | jq -r '.[].name' | sort -r | awk -F'/' '/[0-9.]+$/ {print $NF; exit}')"
19echo "branch=$branch"
20echo "branch=$branch" >> "$GITHUB_OUTPUT"
21env:22GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}23
24run-default-branch:25name: Run default branch26runs-on: ubuntu-latest27needs: setup28
29strategy:30matrix:31workflow:32- ci.yml33- documentation.yml34- js-ci.yml35- operator-ci.yml36- snyk-analysis.yml37- trivy-analysis.yml38
39steps:40- name: Run workflow41run: gh workflow run -R ${{ github.repository }} ${{ matrix.workflow }}42env:43GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}44
45run-latest-release-branch:46name: Run latest release branch47needs: setup48runs-on: ubuntu-latest49
50strategy:51matrix:52workflow:53- snyk-analysis.yml54
55steps:56- run: echo ${{ needs.setup.outputs.latest-release-branch }}57- name: Run workflow58run: gh workflow run -R ${{ github.repository }} ${{ matrix.workflow }} --ref ${{ needs.setup.outputs.latest-release-branch }}59env:60GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}61