-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.18 KB
/
xml.yml
File metadata and controls
47 lines (39 loc) · 1.18 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
44
45
46
47
name: Update Feed on Release
on:
push:
tags:
- '*'
jobs:
update-feed:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Generate XML files
run: npm run xml
- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain static/feed.xml static/sitemap.xml)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add static/feed.xml static/sitemap.xml
git commit -m "Update feed and sitemap for release ${{ github.ref_name }}"
git push