-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (46 loc) · 1.51 KB
/
liked.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 }}