From 022a7e5994fe31db4188127803a964ab23f6888d Mon Sep 17 00:00:00 2001 From: Ilyes Ben Dlala Date: Wed, 3 Nov 2021 10:36:40 +0100 Subject: [PATCH] Changed SCB-BOT PR's token to GitHub PAT Signed-off-by: Ilyes Ben Dlala --- .github/workflows/scb-bot.yaml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/scb-bot.yaml b/.github/workflows/scb-bot.yaml index d0c296e4f9..239b526d2e 100644 --- a/.github/workflows/scb-bot.yaml +++ b/.github/workflows/scb-bot.yaml @@ -1,14 +1,14 @@ name: Check outdated scanners -on: +on: schedule: - - cron: "15 9 * * *" # Daily at 9:15 (avoids the beginning of the hour congestion) + - cron: "15 9 * * *" # Daily at 9:15 (avoids the beginning of the hour congestion) jobs: version-compare: runs-on: ubuntu-latest strategy: matrix: scanner: - - amass # Scanner that needs to be updated + - amass - angularjs-csti-scanner - cmseek - gitleaks @@ -23,12 +23,11 @@ jobs: - whatweb - wpscan - zap - - zap-advanced - # These are commented out for the moment to avoid accidental multiple erroneous PRs + - zap-advanced # missing scanners are : nmap, nikto, typo3scan steps: - uses: actions/checkout@v2 - + - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v3 with: @@ -40,11 +39,11 @@ jobs: - name: Fetch scanner's version API uses: mikefarah/yq@v4.4.1 with: - cmd: echo versionApi=$(yq e .versionApi scanners/${{ matrix.scanner }}/Chart.yaml) >> $GITHUB_ENV + cmd: echo versionApi=$(yq e .versionApi scanners/${{ matrix.scanner }}/Chart.yaml) >> $GITHUB_ENV - name: Fetch latest release scanner version run: echo release=$((curl -sL ${{env.versionApi}} ) | jq -r ".tag_name") | tr -d "v" >> $GITHUB_ENV - + - name: Fetch local scanner version uses: mikefarah/yq@v4.4.1 with: @@ -59,20 +58,20 @@ jobs: echo pullRequest=$pullRequestTitle >> $GITHUB_ENV echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token - echo prExists=$(gh pr list --state open --limit 100 | grep -F "$pullRequestTitle" -c) >> $GITHUB_ENV + echo prExists=$(gh pr list --state open --limit 100 | grep -F "$pullRequestTitle" -c) >> $GITHUB_ENV - - name : Upgrade Scanner - if: ${{ env.release != env.local && env.prExists == 0 }} + - name: Upgrade Scanner + if: ${{ env.release != env.local && env.prExists == 0 }} uses: mikefarah/yq@v4.4.1 with: - # appVersion value in chart is replaced with release value. Empty lines are deleted in the process + # appVersion value in chart is replaced with release value. Empty lines are deleted in the process cmd: yq e --inplace '.appVersion = "v${{env.release}}"' ./scanners/${{ matrix.scanner }}/Chart.yaml - - name : Create Pull Request - if: ${{ env.release != env.local && env.prExists == 0 }} + - name: Create Pull Request + if: ${{ env.release != env.local && env.prExists == 0 }} uses: peter-evans/create-pull-request@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.SCB_BOT_USER_TOKEN }} committer: secureCodeBoxBot author: secureCodeBoxBot title: ${{ env.pullRequest }}