File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Update Feed on Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' *'
7+
8+ jobs :
9+ update-feed :
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+ with :
18+ token : ${{ secrets.GITHUB_TOKEN }}
19+
20+ - name : Setup Node.js
21+ uses : actions/setup-node@v4
22+ with :
23+ node-version : ' 20'
24+
25+ - name : Install dependencies
26+ run : npm ci
27+
28+ - name : Generate XML files
29+ run : npm run xml
30+
31+ - name : Check for changes
32+ id : verify-changed-files
33+ run : |
34+ if [ -n "$(git status --porcelain static/feed.xml static/sitemap.xml)" ]; then
35+ echo "changed=true" >> $GITHUB_OUTPUT
36+ else
37+ echo "changed=false" >> $GITHUB_OUTPUT
38+ fi
39+
40+ - name : Commit and push changes
41+ if : steps.verify-changed-files.outputs.changed == 'true'
42+ run : |
43+ git config --local user.email "action@github.com"
44+ git config --local user.name "GitHub Action"
45+ git add static/feed.xml static/sitemap.xml
46+ git commit -m "Update feed and sitemap for release ${{ github.ref_name }}"
47+ git push
You can’t perform that action at this time.
0 commit comments