-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (66 loc) · 2.21 KB
/
theme.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: approve theme
on:
issues:
types:
- labeled
permissions: write-all
jobs:
approve:
if: github.event.label.name == 'approved'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Parse issue
id: parse
uses: onmax/[email protected]
with:
issue_number: ${{ github.event.issue.number }}
- uses: actions/checkout@v2
with:
submodules: true
- name: Update themes.json
run: |
ls
echo "`jq '.themes+=[{"name":"${{ fromJson(steps.parse.outputs.payload).Name }}","repo":"${{ fromJson(steps.parse.outputs.payload).Repo }}","branch":"${{ fromJson(steps.parse.outputs.payload).Branch }}","config":"${{ fromJson(steps.parse.outputs.payload).Config }}","desc":"${{ fromJson(steps.parse.outputs.payload).Description }}"}]' themes.json`" > themes.json
- name: add submodule
run: |
git submodule add -b '${{ fromJson(steps.parse.outputs.payload).Branch }}' -- '${{ fromJson(steps.parse.outputs.payload).Repo }}' 'themes/${{ fromJson(steps.parse.outputs.payload).Name }}'
- name: add to list
run: |
python -m pip install requests
python -m pip install pillow
python update_readme.py
- name: commit
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions - add theme"
git add --all
git commit -m "Add theme" || echo "No changes to commit"
git push
- name: Close Issue
uses: peter-evans/close-issue@v2
with:
comment: |
theme request approved, submmodule added
labels: |
approved
theme
deny:
if: github.event.label.name == 'denied'
runs-on: ubuntu-latest
steps:
- name: Close Issue
uses: peter-evans/close-issue@v2
with:
issue-number: ${{ github.event.issue.number }}
comment: |
theme request denied
labels: |
denied
theme