-
Notifications
You must be signed in to change notification settings - Fork 15
40 lines (38 loc) · 1.27 KB
/
update-readme.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: 🧚🏻♀️ Update project readme
on:
schedule:
- cron: "38 8 * * 0" # every Sunday at 8:38 AM UTC
workflow_dispatch:
release:
types: [published]
jobs:
update-posts:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Grype
shell: bash
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b /usr/local/bin
- name: Get latest grype scan results for latest images, insert into README.md
shell: bash
run: |
python3 ./.github/scripts/update-readme.py
- name: Commit and push changes (if any)
env:
CI_COMMIT_MESSAGE: update readme with latest CVE data
CI_COMMIT_AUTHOR: github-actions[bot]
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "[email protected]"
if [[ `git status --porcelain --untracked-files=no` ]]; then
# Changes
git add README.md
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push
else
# No changes
echo "no changes to commit"
exit 0
fi