Remove scheduled from individual workflows (#21847)

This commit is contained in:
Stian Thorgersen 2023-07-21 11:51:10 +02:00 committed by GitHub
parent 7336ff07ac
commit 6220a9d71f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 68 additions and 50 deletions

View file

@ -6,8 +6,6 @@ on:
- main
- dependabot/**
pull_request:
schedule:
- cron: 0 20,23,2,5 * * *
workflow_dispatch:
env:
@ -28,7 +26,6 @@ jobs:
conditional:
name: Check conditional workflows and jobs
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'
runs-on: ubuntu-latest
outputs:
ci: ${{ steps.conditional.outputs.ci }}
@ -607,7 +604,7 @@ jobs:
check:
name: Status Check - Keycloak CI
if: always() && ( github.event_name != 'schedule' || github.repository == 'keycloak/keycloak' )
if: always()
needs:
- conditional
- check-set-status

View file

@ -7,8 +7,7 @@ on:
- dependabot/**
pull_request:
branches: [main]
schedule:
- cron: 0 9 * * 2
workflow_dispatch:
concurrency:
# Only cancel jobs for PR updates
@ -23,7 +22,6 @@ jobs:
conditional:
name: Check conditional workflows and jobs
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'
runs-on: ubuntu-latest
outputs:
java: ${{ steps.conditional.outputs.codeql-java }}
@ -94,7 +92,7 @@ jobs:
check:
name: Status Check - CodeQL
if: always() && ( github.event_name != 'schedule' || github.repository == 'keycloak/keycloak' )
if: always()
needs: [conditional, java, themes]
runs-on: ubuntu-latest

View file

@ -6,8 +6,6 @@ on:
- main
- dependabot/**
pull_request:
schedule:
- cron: 0 5 * * *
workflow_dispatch:
env:
@ -27,7 +25,6 @@ jobs:
conditional:
name: Check conditional workflows and jobs
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'
runs-on: ubuntu-latest
outputs:
documentation: ${{ steps.conditional.outputs.documentation }}
@ -125,7 +122,7 @@ jobs:
check:
name: Status Check - Keycloak Documentation
if: always() && ( github.event_name != 'schedule' || github.repository == 'keycloak/keycloak' )
if: always()
needs:
- conditional
- check-set-status

View file

@ -25,7 +25,6 @@ jobs:
conditional:
name: Check conditional workflows and jobs
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'
runs-on: ubuntu-latest
outputs:
guides: ${{ steps.conditional.outputs.guides }}
@ -64,7 +63,7 @@ jobs:
check:
name: Status Check - Keycloak Guides
if: always() && ( github.event_name != 'schedule' || github.repository == 'keycloak/keycloak' )
if: always()
needs:
- conditional
- check-set-status

View file

@ -6,8 +6,6 @@ on:
- main
- dependabot/**
pull_request:
schedule:
- cron: 0 20,23,2,5 * * *
workflow_dispatch:
concurrency:
@ -22,7 +20,6 @@ defaults:
jobs:
conditional:
name: Check conditional workflows and jobs
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'
runs-on: ubuntu-latest
outputs:
js-ci: ${{ steps.conditional.outputs.js }}
@ -197,7 +194,7 @@ jobs:
browser: [chrome, firefox]
exclude:
# Only test with Firefox on scheduled runs
- browser: ${{ github.event_name != 'schedule' && 'firefox' || '' }}
- browser: ${{ github.event_name != 'workflow_dispatch' && 'firefox' || '' }}
steps:
- uses: actions/checkout@v3
@ -287,7 +284,7 @@ jobs:
check:
name: Status Check - Keycloak JavaScript CI
if: always() && ( github.event_name != 'schedule' || github.repository == 'keycloak/keycloak' )
if: always()
needs:
- conditional
- check-set-status

View file

@ -6,8 +6,6 @@ on:
- main
- dependabot/**
pull_request:
schedule:
- cron: 0 20,23,2,5 * * *
workflow_dispatch:
env:
@ -29,7 +27,6 @@ jobs:
conditional:
name: Check conditional workflows and jobs
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'
runs-on: ubuntu-latest
outputs:
operator: ${{ steps.conditional.outputs.operator }}
@ -226,7 +223,7 @@ jobs:
check:
name: Status Check - Keycloak Operator CI
if: always() && ( github.event_name != 'schedule' || github.repository == 'keycloak/keycloak' )
if: always()
needs:
- conditional
- check-set-status

60
.github/workflows/schedule-nightly.yml vendored Normal file
View file

@ -0,0 +1,60 @@
name: Scheduled nightly workflows
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
setup:
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak'
runs-on: ubuntu-latest
outputs:
latest-release-branch: ${{ steps.latest-release.outputs.branch }}
steps:
- id: latest-release
run: |
branch="release/$(gh api repos/keycloak/keycloak/branches | jq -r '.[].name' | sort -r | awk -F'/' '/[0-9.]+$/ {print $NF; exit}')"
echo "branch=$branch"
echo "branch=$branch" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run-default-branch:
name: Run default branch
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
workflow:
- cy.yml
- documentation.yml
- js-ci.yml
- operator-ci.yml
- snyk-analysis.yml
- trivy-analysis.yml
steps:
- name: Run workflow
run: gh workflow run -R ${{ github.repository }} ${{ matrix.workflow }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run-latest-release-branch:
name: Run latest release branch
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
workflow:
- snyk-analysis.yml
steps:
- run: echo ${{ needs.setup.outputs.latest-release-branch }}
- name: Run workflow
run: gh workflow run -R ${{ github.repository }} ${{ matrix.workflow }} -R ${{ needs.setup.outputs.latest-release-branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,25 +0,0 @@
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 }}

View file

@ -1,8 +1,6 @@
name: Trivy
on:
schedule:
- cron: 0 6 * * *
workflow_dispatch:
defaults: