-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (44 loc) · 1.28 KB
/
update_foops_badge.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Update FOOPS Score Badge
on:
workflow_run:
workflows: ["docs"]
types:
- completed
env:
GIT_USER_NAME: BattINFO Developers
GIT_USER_EMAIL: "[email protected]"
jobs:
update-badge:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install requests
- name: Fetch FOOPS score and update badge
run: |
python docs/scripts/generate_foops_badge.py
- name: Configure Git
run: |
git config --local user.email "${{ env.GIT_USER_EMAIL }}"
git config --local user.name "${{ env.GIT_USER_NAME }}"
- name: Commit any changes before pulling
run: |
git add -A
git diff --staged --quiet || git commit -m "Stash changes before pull"
- name: Pull latest changes
run: git pull origin master --rebase
- name: Commit changes
run: |
git add README.md
git diff --staged --quiet || git commit -m "Update FOOPS score badge"
- name: Push changes
run: git push origin HEAD:master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}