[WIP] Trigger mirror update test #99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mirror update notification | |
on: | |
pull_request: | |
# branches: | |
# - master | |
paths: | |
- backend_modules/libvirt/base/main.tf | |
jobs: | |
Check-changed-files: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- name: Get changed URLs | |
run: | | |
DIFF=$(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\n/' | uniq) | |
echo "DIFF=$DIFF" >> $GITHUB_ENV | |
- name: Comment on the pull request | |
if: env.DIFF | |
uses: peter-evans/commit-comment@v1 | |
with: | |
body: | | |
This pull request modifies the URLs of the following repositories. | |
Please consider updating the CI and BV mirror configurations accordingly. | |
${{ env.DIFF }} |