-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.15 KB
/
update-gallery-json.yaml
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
name: Update gallery JSON file
on:
push:
branches:
- '*'
paths:
- repositories.json
pull_request:
branches:
- '*'
jobs:
gallery:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run gallery_generator.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python src/gallery_generator.py
- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
GIT_STATUS=$(git status -s)
[[ ! -z "$GIT_STATUS" ]] && git add gallery.json && git commit -m "auto-generate-gallery" -a || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.head_ref }}