-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* strip tags Signed-off-by: Daniel Sieradski <[email protected]> * hrm Signed-off-by: Daniel Sieradski <[email protected]> * cache bust Signed-off-by: Daniel Sieradski <[email protected]> * and again Signed-off-by: Daniel Sieradski <[email protected]> * cache bust Signed-off-by: Daniel Sieradski <[email protected]> * formatting stuff Signed-off-by: Daniel Sieradski <[email protected]> * again Signed-off-by: Daniel Sieradski <[email protected]> * nothing older than one day + formatting Signed-off-by: Daniel Sieradski <[email protected]> * cache bust Signed-off-by: Daniel Sieradski <[email protected]> * formatting and timing Signed-off-by: Daniel Sieradski <[email protected]> * more options and styling Signed-off-by: Daniel Sieradski <[email protected]> * revalidate Signed-off-by: Daniel Sieradski <[email protected]> * add internal docs Signed-off-by: Daniel Sieradski <[email protected]> * debug Signed-off-by: Daniel Sieradski <[email protected]> * fix validation Signed-off-by: Daniel Sieradski <[email protected]> * Derp Signed-off-by: Daniel Sieradski <[email protected]> * more debugging Signed-off-by: Daniel Sieradski <[email protected]> * more formatting stuff Signed-off-by: Daniel Sieradski <[email protected]> * move date block Signed-off-by: Daniel Sieradski <[email protected]> * add showimg Signed-off-by: Daniel Sieradski <[email protected]> * Update docs Signed-off-by: Daniel Sieradski <[email protected]> * add utc mark Signed-off-by: Daniel Sieradski <[email protected]> * 1.2.7
- Loading branch information
1 parent
95ee5bd
commit 116b9e2
Showing
14 changed files
with
460 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,17 +14,21 @@ Push RSS feed updates to Slack via GitHub Actions | |
|
||
4. Create a new workflow in your desired repository (e.g. `.github/workflows/slackfeedbot.yml`) and drop in the follwing, where: | ||
|
||
- `rss` is an RSS feed URL. | ||
- `slack_webhook` is the URL of your Slack webhook (this can and probably | ||
- `rss`: An RSS feed URL. | ||
- `slack_webhook`: The URL of your Slack webhook (this can and probably | ||
should be a repository or organization secret). | ||
- `cache_dir` is the folder in which you want to cache RSS data to prevent | ||
- `cache_dir`: The folder in which you want to cache RSS data to prevent | ||
publishing duplicates (e.g., `./slackfeedbot-cache`), or alternately... | ||
- `interval` is the number of minutes between runs of the parent workflow, as | ||
- `interval`: The number of minutes between runs of the parent workflow, as | ||
specified in the `cron` section of the `schedule` workflow trigger (may | ||
publish duplicates due to post pinning). | ||
- `unfurl` tells Slack to show the [Open Graph](https://ogp.me/) preview. If | ||
set to `false` the title, date, short description, and a link to the feed item | ||
will be posted. Defaults to `false` because it's kind of flaky. | ||
- `unfurl`: Tells Slack to show the [Open Graph](https://ogp.me/) preview. | ||
Defaults to `false` because it's kind of flaky. Not customizable. Use | ||
the below settings for customizd display. | ||
- `show_desc`: Whether to show the post description. Defaults to `true`. | ||
- `show_img`: Whether to show the post image. Defaults to `true`. | ||
- `show_date`: Whether to show the post date. Defaults to `true`. | ||
- `show_link`: Whether to show the Read more link, linking back to the post. Defaults to `true`. | ||
|
||
## Examples | ||
|
||
|
@@ -54,7 +58,7 @@ jobs: | |
key: feed-cache-${{ steps.generate-key.outputs.cache-key }} | ||
restore-keys: feed-cache- | ||
- name: NYT | ||
uses: 'selfagency/[email protected].6' | ||
uses: 'selfagency/[email protected].7' | ||
with: | ||
rss: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml' | ||
slack_webhook: ${{ secrets.SLACK_WEBHOOK }} | ||
|
@@ -75,45 +79,13 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: NYT | ||
uses: 'selfagency/[email protected].6' | ||
uses: 'selfagency/[email protected].7' | ||
with: | ||
rss: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml' | ||
slack_webhook: ${{ secrets.SLACK_WEBHOOK }} | ||
interval: 15 | ||
``` | ||
|
||
### Unfurl URLs | ||
|
||
``` | ||
name: FeedBot | ||
on: | ||
schedule: | ||
- cron: '*/15 * * * *' | ||
jobs: | ||
rss-to-slack: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate cache key | ||
uses: actions/github-script@v6 | ||
id: generate-key | ||
with: | ||
script: | | ||
core.setOutput('cache-key', new Date().valueOf()) | ||
- name: Retrieve cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ./slackfeedbot-cache | ||
key: feed-cache-${{ steps.generate-key.outputs.cache-key }} | ||
restore-keys: feed-cache- | ||
- name: NYT | ||
uses: 'selfagency/[email protected]' | ||
with: | ||
rss: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml' | ||
slack_webhook: ${{ secrets.SLACK_WEBHOOK }} | ||
cache_dir: './slackfeedbot-cache' | ||
unfurl: true | ||
``` | ||
|
||
### Multiple feeds | ||
|
||
``` | ||
|
@@ -138,13 +110,13 @@ jobs: | |
key: feed-cache-${{ steps.generate-key.outputs.cache-key }} | ||
restore-keys: feed-cache- | ||
- name: LAT | ||
uses: 'selfagency/[email protected].6' | ||
uses: 'selfagency/[email protected].7' | ||
with: | ||
rss: 'https://www.latimes.com/rss2.0.xml' | ||
slack_webhook: ${{ secrets.SLACK_WEBHOOK }} | ||
cache_dir: './slackfeedbot-cache' | ||
- name: WaPo | ||
uses: 'selfagency/[email protected].6' | ||
uses: 'selfagency/[email protected].7' | ||
with: | ||
rss: 'https://feeds.washingtonpost.com/rss/homepage' | ||
slack_webhook: ${{ secrets.SLACK_WEBHOOK }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.