Skip to content

Post Tweet To Mastodon #40906

Post Tweet To Mastodon

Post Tweet To Mastodon #40906

name: Post Tweet To Mastodon
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
jobs:
post-tweet-to-mastodon:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Download cached posted tweet
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
name: posted-tweet
if_no_artifact_found: warn
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run script
run: pnpm run start
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_URL: ${{ secrets.MASTODON_URL }}
- uses: actions/upload-artifact@v3
name: Upload cached posted tweet
with:
name: posted-tweet
path: ./posted-tweet.json