-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (36 loc) 路 1.1 KB
/
RSS Feed Notification.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
42
43
name: RSS Feed Notification
on:
workflow_run:
workflows: ["Update Feed"]
types:
- completed
jobs:
update_after_feed:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Set up Python
uses: actions/setup-python@v4.7.1
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install feedparser
pip install requests
- name: Run Python script
env:
SECRET_WEBHOOK_URL: ${{ secrets.SECRET_WEBHOOK_URL }}
SECRET_WEBHOOK_URL2: ${{ secrets.SECRET_WEBHOOK_URL2 }}
run: |
python RSSparser.py $SECRET_WEBHOOK_URL $SECRET_WEBHOOK_URL2
if [ "$(git status --porcelain)" ]; then
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@github.com"
git add posted_links.txt
git commit -am "Updated posted_links.txt"
git push
else
echo "No new payloads found. Exiting cleanly."
fi