forked from h43z/rssify
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaction.yml
More file actions
89 lines (89 loc) · 2.96 KB
/
action.yml
File metadata and controls
89 lines (89 loc) · 2.96 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: 'RSSify Any'
description: 'To generate an RSS feed for any blog/website'
inputs:
title:
description: 'RSS title'
required: true
subtitle:
description: 'RSS subtitle/description'
required: false
url:
description: 'Website url'
required: true
language:
description: 'RSS language'
required: true
default: en
author-name:
description: 'RSS author name'
required: true
default: TabHub
author-email:
description: 'RSS author email'
required: true
default: 'idegorepl@gmail'
item-title-css:
description: 'CSS selector to get item title'
required: true
item-url-css:
description: 'CSS selector to get item url'
required: true
item-author-css:
description: 'CSS selector to get item author'
required: false
item-description-css:
description: 'CSS selector to get item description'
required: false
item-date-css:
description: 'CSS selector to get Item post date'
required: false
item-date-format:
description: 'Date format of item post date, help to parse date'
required: false
item-timezone:
description: 'Timezone applied to item post date'
required: false
default: 'Asia/Shanghai'
runs:
using: "composite"
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install requests feedgen bs4 pytz
shell: bash
- name: Pass Inputs to Shell
run: |
echo "TITLE=${{ inputs.title }}" >> $GITHUB_ENV
echo "SUBTITLE=${{ inputs.subtitle }}" >> $GITHUB_ENV
echo "URL=${{ inputs.url }}" >> $GITHUB_ENV
echo "AUTHOR_NAME=${{ inputs.author-name }}" >> $GITHUB_ENV
echo "AUTHOR_EMAIL=${{ inputs.author-email }}" >> $GITHUB_ENV
echo "LANGUAGE=${{ inputs.language }}" >> $GITHUB_ENV
echo "ITEM_TITLE_CSS=${{ inputs.item-title-css }}" >> $GITHUB_ENV
echo "ITEM_URL_CSS=${{ inputs.item-url-css }}" >> $GITHUB_ENV
echo "ITEM_AUTHOR_CSS=${{ inputs.item-author-css }}" >> $GITHUB_ENV
echo "ITEM_DESCRIPTION_CSS=${{ inputs.item-description-css }}" >> $GITHUB_ENV
echo "ITEM_DATE_CSS=${{ inputs.item-date-css }}" >> $GITHUB_ENV
echo "ITEM_DATE_FORMAT=${{ inputs.item-date-format }}" >> $GITHUB_ENV
echo "ITEM_TIMEZONE=${{ inputs.item-timezone }}" >> $GITHUB_ENV
shell: bash
- name: Generate RSS files
run: python ${{ github.action_path }}/rssify.py
shell: bash
- name: Store RSS files in the repo
run: |
# git commit if there's any change
if test -n "$(git status --porcelain 2>/dev/null)"; then
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Update RSS files"
git push origin ${GITHUB_REF##*/}
fi
shell: bash
branding:
icon: 'rss'
color: 'green'