generated from kubestellar/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (35 loc) · 1.07 KB
/
build-index.yml
File metadata and controls
43 lines (35 loc) · 1.07 KB
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
name: Build Mission Index
on:
push:
branches: [master]
paths:
- 'solutions/**'
- '!solutions/index.json'
workflow_dispatch:
permissions:
contents: write
jobs:
build-index:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
working-directory: scripts
run: npm install --no-audit
- name: Build mission index
run: node scripts/build-index.mjs
- name: Check for changes
id: changes
run: |
git diff --quiet solutions/index.json && echo "changed=false" >> $GITHUB_OUTPUT || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push index
if: steps.changes.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add solutions/index.json
git commit -s -m "🌱 Auto-update mission index"
git push