Skip to content

Commit

Permalink
feat: add settings for limiting number of posts per run
Browse files Browse the repository at this point in the history
New settings:

- `initial-post-limit`: The maximum number of posts created on the first run, if no cache file exists (default: unlimited)
- `post-limit`: The maximum number of posts created per run (default: unlimited)

Closes #9
  • Loading branch information
joschi committed Feb 2, 2025
1 parent fdaba69 commit 99c1a57
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 67 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Blueskyfeedbot
# Bluesky Feed Bot

Blueskyfeedbot is a bot that posts RSS feeds to Bluesky via GitHub Actions.
Bluesky Feed Bot is a GitHub Action for posting RSS feeds to Bluesky via GitHub Actions workflows.

## Usage

Expand All @@ -14,7 +14,7 @@ Blueskyfeedbot is a bot that posts RSS feeds to Bluesky via GitHub Actions.
2. Create a new GitHub repository.
3. Go to your repository settings at `https://github.com/${YOUR_REPO}/settings/secrets/actions/new`, and add a new
secret with the value of the access token.
4. Add a file named `.github/workflows/blueskyfeedbot.yml` with the following content:
4. Add a file named `.github/workflows/blueskyfeedbot.yml` with the following content:

```yaml
name: FeedBot
Expand Down Expand Up @@ -42,12 +42,15 @@ Blueskyfeedbot is a bot that posts RSS feeds to Bluesky via GitHub Actions.
key: feed-cache-${{ steps.generate-key.outputs.cache-key }}
restore-keys: feed-cache-
- name: GitHub
uses: 'joschi/blueskyfeedbot@v0.0.2'
uses: 'joschi/blueskyfeedbot@v1'
with:
# This is the RSS feed you want to publish
rss-feed: https://www.githubstatus.com/history.rss
# Template of status posted to Bluesky (Handlebars)
template: '{{item.title}} {{item.link}}'
template: |
{{item.title}}
{{item.link}}
# This is your service URL (optional)
service-url: https://bsky.social
# This is the Bluesky username (example: username.bsky.social)
Expand All @@ -56,6 +59,8 @@ Blueskyfeedbot is a bot that posts RSS feeds to Bluesky via GitHub Actions.
password: ${{ secrets.BLUESKY_PASSWORD }}
# This is a path to the cache file, using the above cache path
cache-file: ${{ github.workspace }}/blueskyfeedbot/cache.json
# The maximum number of posts created on the first run
initial-post-limit: 10
```
5. Commit and publish your changes.
Expand Down
9 changes: 5 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ inputs:
required: true
cache-limit:
description: 'Cache limit'
required: false
default: '100'
initial-post-limit:
description: 'The maximum number of posts created on the first run, if no cache file exists (default: unlimited)'
post-limit:
description: 'The maximum number of posts created per run (default: unlimited)'
dry-run:
description: 'Only fetch RSS feed and update cache but skip posting to Bluesky'
required: false
default: 'false'
disable-facets:
description: 'Disable automatic detection of rich text facets'
required: false
default: false
default: 'false'
runs:
using: 'node20'
main: 'dist/index.js'
Loading

0 comments on commit 99c1a57

Please sign in to comment.