-
Notifications
You must be signed in to change notification settings - Fork 278
70 lines (59 loc) · 1.99 KB
/
build_index.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
name: Build index
on:
workflow_dispatch:
push:
branches:
- extensions
paths:
- 'extensions/**.json'
- 'tags.json'
- 'index.json'
permissions:
contents: write
jobs:
build-index:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- name: Checkout extensions
uses: actions/checkout@v4
with:
fetch-depth: 2
ref: 'extensions'
path: extensions
- name: Checkout master
uses: actions/checkout@v4
with:
fetch-depth: 2
ref: 'master'
path: master
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build index
run: python -B extensions/.github/scripts/build_index.py --build-branch extensions --deploy-branch master
- name: Get last commit message - extensions
id: last-commit-message-extensions
run: echo "msg=$(git -C extensions log -1 --pretty=%s)" >> $GITHUB_OUTPUT
- name: Get last commit message - master
id: last-commit-message-master
run: echo "msg=$(git -C master log -1 --pretty=%s)" >> $GITHUB_OUTPUT
- name: Commit - master
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ steps.last-commit-message-master.outputs.msg }}
commit_options: '--amend --no-edit'
file_pattern: '*.json'
push_options: '--force'
skip_fetch: true
repository: master
- name: Commit - extensions
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ steps.last-commit-message-extensions.outputs.msg }}
commit_options: '--amend --no-edit'
file_pattern: '*.json'
push_options: '--force'
skip_fetch: true
repository: extensions