-
-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (34 loc) · 1.1 KB
/
rss_links_md.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
name: RSS Scan and MD Generation
on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- master
jobs:
generate_md_from_sitemap:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: npm install --prefix generate_md
- name: Run the script
run: node generate_md/generate_md.js ${{ secrets.GITHUB_TOKEN }}
- name: Remove unnecessary files
run: |
find . -mindepth 1 -type d ! -path './.git*' ! -path './.github*' -print0 | xargs -0 rm -rf
find . -maxdepth 1 -type f -not -name 'rss_links.md' -print0 | xargs -0 rm -f
- name: Commit and push changes
run: |
git config user.name "${{ secrets.USERNAME }}"
git config user.email "${{ secrets.EMAIL }}"
git add .
git commit -m "Update master branch"
git push --force --quiet origin HEAD:refs/heads/rss-md
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}