-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.09 KB
/
update-manifest.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
name: Generate Manifest
on:
push:
branches:
- main
workflow_dispatch: # Allows manual triggering from the Actions tab
jobs:
generate-manifest:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v4
# Run the script to generate the manifest.json
- name: Run manifest generation script
run: node generate-manifest.js
# Check if the manifest.json has changed
- name: Check for changes
run: |
git diff --exit-code ./manifest.json || echo "Changes detected"
# Stage and commit the changes if any were made
- name: Commit and push changes
if: ${{ success() && (steps.Check_for_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 ./manifest.json
git commit -m "Update manifest.json"
git push