forked from uyuni-project/sumaform
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 1.09 KB
/
mirror-update-warning.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
name: Mirror update notification
on:
pull_request:
# branches:
# - master
paths:
- backend_modules/libvirt/base/main.tf
jobs:
check-image-urls:
name: Check updated image URLs
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Find modified image URLs
run: |
echo "IMAGE_LIST<<EOF" >> $GITHUB_ENV
git diff -p -U0 --no-color --diff-filter=M -G"\{var\.mirror\}" \
${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} \
-- backend_modules/libvirt/base/main.tf | \
grep "^[+-] " | sed 's/^[+-]\s*\([^ ]*\).*$/ - `\1`/' | uniq >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Comment on the pull request
if: env.IMAGE_LIST
uses: actions-cool/maintain-one-comment@v3
with:
body: |
This pull request updates the URLs of the following images:
${{ env.IMAGE_LIST }}
Please consider updating the CI and BV mirror configurations accordingly.