Skip to content

Commit

Permalink
add a scheduled task to check the scorecard image digest and open a P…
Browse files Browse the repository at this point in the history
…R if need to update them

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
  • Loading branch information
nunnatsa committed May 15, 2023
1 parent c53334f commit 65d1f83
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/regenerate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Auto-Update Scorecard Image Digests
on:
schedule:
- cron: '0 4/4 * * *'
workflow_dispatch:
jobs:
build:
name: operator-sdk Update Scorecard Image Digests Job
if: (github.repository == 'operator-framework/operator-sdk')
runs-on: ubuntu-latest
steps:
- name: check for existing PR
run: |-
if curl -s -L https://api.github.com/repos/operator-framework/operator-sdk/pulls | jq .[].title | grep -q "Update Scorecard Image Digests"; then
echo "There is an existing PR with name 'Update Scorecard Image Digests'; skipping; To run again, close the existing PR"
else
echo "NEW_PR=true" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
if: ${{ env.NEW_PR }}
with:
ref: main

- uses: actions/setup-go@v4
if: ${{ env.NEW_PR }}
with:
go-version: '1.19' # The Go version to download (if necessary) and use.

- name: update the scorecard image digests
if: ${{ env.NEW_PR }}
run: |
make update-scorecard-images
if ! git diff --quiet --exit-code; then
echo "CHANGED=true" >> $GITHUB_ENV
echo "found new scorecard image digests. open a PR to update them"
fi
- name: Regenerate # to update the CLI docs, with the new digests
if: ${{ env.CHANGED }}
run: make generate

- uses: peter-evans/create-pull-request@v3
if: ${{ env.CHANGED }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
Update Scorecard Image Digests
Signed-off-by: operator-sdk Bump Bot <noreply@github.com>
committer: operator-sdk Bump Bot <noreply@github.com>
title: "Update Scorecard Image Digests"
body: |
Update Scorecard Image Digests
Executed by operator-sdk Update Image Digest Bot.
team-reviewers: reviewers, approvers
branch: update-scorecard-image-digests
delete-branch: true

0 comments on commit 65d1f83

Please sign in to comment.