-
-
Notifications
You must be signed in to change notification settings - Fork 949
34 lines (30 loc) · 1.07 KB
/
update-site-data.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
name: Update sites rating and statistics
on:
pull_request:
branches: [ dev ]
types: [opened, synchronize]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: build application
run: |
pip3 install .
python3 ./utils/update_site_data.py --empty-only
- name: Commit and push changes
run: |
git config --global user.name "Maigret autoupdate"
git config --global user.email "[email protected]"
echo `git name-rev ${{ github.event.pull_request.head.sha }} --name-only`
export BRANCH=`git name-rev ${{ github.event.pull_request.head.sha }} --name-only | sed 's/remotes\/origin\///'`
echo $BRANCH
git remote -v
git checkout $BRANCH
git add sites.md
git commit -m "Updated site list and statistics"
git push origin $BRANCH