Skip to content

Commit c5ce900

Browse files
committed
Added cronjob to workflow
tracker only checks open PRs now and uses fgrep instead of grep Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
1 parent 3147b05 commit c5ce900

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎.github/workflows/scb-bot.yaml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name: Check outdated scanners
22
on:
33
push:
4-
# schedule:
5-
# - cron: "0 8 * * *"
4+
schedule:
5+
- cron: "15 9 * * *"
66
jobs:
77
version-compare:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
1111
scanner:
12-
- amass
13-
# - angularjs-csti-scanner
12+
- amass # Scanner that needs to be updated
13+
- angularjs-csti-scanner # Scanner that does not need to be updated
1414
# - gitleaks
1515
# - kube-hunter
1616
# - kubeaudit
@@ -49,16 +49,16 @@ jobs:
4949
with:
5050
cmd: echo local=$(yq e .appVersion scanners/${{ matrix.scanner }}/Chart.yaml) | tr -d "v" >> $GITHUB_ENV
5151

52-
- name: Check if outdated and if PR already exists
52+
- name: Check if scanner is outdated and if PR already exists
5353
if: ${{ env.release != env.local }}
5454
run: |
5555
echo '${{ matrix.scanner }} scanner is outdated. scB version is ${{env.local}} and remote version is ${{env.release}}'
56-
56+
5757
pullRequestTitle="[sCB-Bot] Upgraded ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}"
5858
echo pullRequest=$pullRequestTitle >> $GITHUB_ENV
5959
6060
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
61-
echo prExists=$(gh pr list --state all --limit 100 | grep "$pullRequestTitle" -c) >> $GITHUB_ENV
61+
echo prExists=$(gh pr list --state open --limit 100 | grep -F "$pullRequestTitle" -c) >> $GITHUB_ENV
6262
6363
- name : Upgrade Scanner
6464
if: ${{ env.release != env.local && env.prExists == 0 }}
@@ -75,7 +75,7 @@ jobs:
7575
committer: secureCodeBoxBot <securecodebox@iteratec.com>
7676
author: secureCodeBoxBot <securecodebox@iteratec.com>
7777
title: ${{ env.pullRequest }}
78-
body: "This is an automated Pull Request by the sCB-Bot. It Upgrades ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}"
78+
body: "This is an automated Pull Request by the sCB-Bot. It upgrades ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}"
7979
branch: "dependencies/upgrading-${{ matrix.scanner }}-to-${{env.release}}"
8080
labels: dependencies,scanner
8181
commit-message: "Upgrading ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}"

0 commit comments

Comments
 (0)