Post from RSS #105
This file contains hidden or 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
| name: Post from RSS | |
| env: | |
| LAST_RUNS_PATH: .last_runs.json | |
| on: | |
| schedule: | |
| - cron: '30 12 * * 2' # Every Tuesday at 12:30 UTC (12:30 GMT), is this working? | |
| workflow_dispatch: | |
| inputs: | |
| force_latest: | |
| description: force_latest | |
| type: number | |
| default: 0 | |
| jobs: | |
| rss: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Set up uv and Python | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Create venv and install dependencies | |
| run: uv sync | |
| - name: Run RSS to Social | |
| env: | |
| FORCE_LATEST: ${{ github.event.inputs.force_latest }} | |
| RSS_FEED_URLS: ${{ vars.RSS_FEED_URLS }} | |
| ACTIVE_SOCIALS: ${{ vars.ACTIVE_SOCIALS }} | |
| BSKY_USERNAME: ${{ vars.BSKY_USERNAME }} | |
| BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }} | |
| REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }} | |
| REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }} | |
| REDDIT_USERNAME: ${{ vars.REDDIT_USERNAME }} | |
| REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }} | |
| REDDIT_SUBREDDIT: ${{ vars.REDDIT_SUBREDDIT }} | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| run: uv run rss_to_social.py | |
| - name: Commit updated ${{ env.LAST_RUNS_PATH }} if changed | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git add $LAST_RUNS_PATH | |
| git diff --cached --quiet || git commit -m "Update $LAST_RUNS_PATH" | |
| continue-on-error: true | |
| - name: Push changes | |
| if: success() | |
| uses: ad-m/github-push-action@v0.8.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |