Skip to content

Commit bab2045

Browse files
authored
FIX: trivy fails on scheduled jobs (#1081)
* fix schedule cron condition syntax * update other jobs
1 parent 9438ea5 commit bab2045

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/trivy.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
3636
steps:
3737
- name: Checkout code
38-
if: github.event_name == 'schedule' && github.event.schedule == '0 23 * * '
38+
if: github.event_name == 'schedule' && github.event.schedule == '0 23 * * *'
3939
uses: actions/checkout@v4
4040
with:
4141
ref: maint-25.02 # tmp branch
4242
- name: Checkout code
43-
if: github.event_name == 'schedule' && github.event.schedule == '0 0 * * '
43+
if: github.event_name == 'schedule' && github.event.schedule == '0 0 * * *'
4444
uses: actions/checkout@v4
4545
with:
4646
ref: main
@@ -74,6 +74,18 @@ jobs:
7474
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
7575
steps:
7676
- name: Checkout code
77+
if: github.event_name == 'schedule' && github.event.schedule == '0 23 * * *'
78+
uses: actions/checkout@v4
79+
with:
80+
ref: maint-25.02 # tmp branch
81+
- name: Checkout code
82+
if: github.event_name == 'schedule' && github.event.schedule == '0 0 * * *'
83+
uses: actions/checkout@v4
84+
with:
85+
ref: main
86+
87+
- name: Checkout code
88+
if: github.event_name != 'schedule'
7789
uses: actions/checkout@v4
7890
with:
7991
ref: ${{ inputs.branch }}
@@ -98,6 +110,18 @@ jobs:
98110
runs-on: ubuntu-22.04
99111
steps:
100112
- name: Checkout code
113+
if: github.event_name == 'schedule' && github.event.schedule == '0 23 * * *'
114+
uses: actions/checkout@v4
115+
with:
116+
ref: maint-25.02 # tmp branch
117+
- name: Checkout code
118+
if: github.event_name == 'schedule' && github.event.schedule == '0 0 * * *'
119+
uses: actions/checkout@v4
120+
with:
121+
ref: main
122+
123+
- name: Checkout code
124+
if: github.event_name != 'schedule'
101125
uses: actions/checkout@v4
102126
with:
103127
ref: ${{ inputs.branch }}

0 commit comments

Comments
 (0)