-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (34 loc) · 1016 Bytes
/
fetch-badge.yml
File metadata and controls
40 lines (34 loc) · 1016 Bytes
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: Fetch Badge
on:
workflow_run:
workflows: ["Test"]
types: [completed]
workflow_dispatch:
permissions:
contents: write
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: gh-pages
fetch-depth: 0
- name: Download badge.svg
run: |
set -euxo pipefail
curl -L -o badge.svg \
"https://github.com/uwabami/rdtool/actions/workflows/test.yml/badge.svg"
- name: Commit & push if changed
run: |
set -euxo pipefail
if git diff --quiet -- badge.svg; then
echo "No changes in badge."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add badge.svg
git commit -m "Mirror CI badge (Test)"
git push origin gh-pages