Liked #17862
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
name: Liked | |
on: | |
push: | |
paths: | |
- .github/workflows/liked.yml # Only run a new workflow every time this file (flat.yaml) file changes | |
workflow_dispatch: # Required even though this is currently empty | |
schedule: | |
- cron: "0 * * * *" # Run this workflow every 5 minutes | |
jobs: | |
liked: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2.3' # Not needed with a .ruby-version file | |
bundler-cache: true | |
- name: Fetch liked | |
run: | | |
bundle exec ruby bin/raindrop-to-liked.rb | |
env: | |
RAINDROP_TOKEN: ${{ secrets.RAINDROP_TOKEN }} | |
RAINDROP_FORCE: true | |
- name: Sync to Arena | |
run: | | |
bundle exec ruby bin/export-to-arena | |
env: | |
ARENA_TOKEN: ${{ secrets.ARENA_TOKEN }} | |
- name: Commit files | |
id: commit | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions" | |
git add content/bookmarks/* | |
git add data/* | |
git commit -m "Sync the liked list" || echo "nothing to do and it is fine" | |
git pull origin ${{ github.ref }} | |
echo "push=true" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Push changes | |
if: steps.commit.outputs.push == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |