FediFetcher/.github/workflows/get_context.yml

46 lines
1.9 KiB
YAML
Raw Normal View History

name: getAllRepliesToKnownPosts
2023-03-07 12:37:30 +01:00
concurrency: get_context
2023-03-06 13:42:15 +01:00
on:
2023-03-06 16:31:13 +01:00
workflow_dispatch:
schedule:
2023-03-06 17:24:08 +01:00
- cron: '3,13,23,33,43,53 * * * *'
2023-03-07 12:37:30 +01:00
2023-03-06 13:42:15 +01:00
jobs:
run:
runs-on: ubuntu-latest
2023-03-06 16:27:45 +01:00
environment: mastodon
2023-03-06 13:42:15 +01:00
steps:
2023-03-09 10:57:58 +01:00
- name: Get latest release
run: |
curl --retry 20 -s https://api.github.com/repos/nanos/mastodon_get_replies/releases/latest | jq .zipball_url | xargs wget -O download.zip
2023-03-09 10:54:28 +01:00
unzip -j download.zip
mkdir artifacts
2023-03-09 10:57:58 +01:00
ls -lR
- name: Set up Python
uses: actions/setup-python@v4
2023-03-06 13:47:24 +01:00
with:
python-version: '3.10'
2023-03-06 14:01:09 +01:00
cache: 'pip' # caching pip dependencies
2023-03-06 14:00:24 +01:00
- run: pip install -r requirements.txt
2023-03-06 13:42:15 +01:00
- name: Download all workflow run artifacts
2023-03-06 14:17:54 +01:00
uses: dawidd6/action-download-artifact@v2
2023-03-06 13:42:15 +01:00
with:
name: artifacts
2023-03-06 14:20:06 +01:00
workflow: get_context.yml
if_no_artifact_found: warn
2023-03-06 14:23:44 +01:00
path: artifacts
2023-03-09 10:57:58 +01:00
- name: Get Directory structure
run: ls -lR
- run: python find_posts.py --lock-hours=0 --access-token=${{ secrets.ACCESS_TOKEN }} --server=${{ vars.MASTODON_SERVER }} --reply-interval-in-hours=${{ vars.REPLY_INTERVAL_IN_HOURS || 0 }} --home-timeline-length=${{ vars.HOME_TIMELINE_LENGTH || 0 }} --max-followings=${{ vars.MAX_FOLLOWINGS || 0 }} --user=${{ vars.USER }} --max-followers=${{ vars.MAX_FOLLOWERS || 0 }} --http-timeout=${{ vars.HTTP_TIMEOUT || 5 }} --max-follow-requests=${{ vars.MAX_FOLLOW_REQUESTS || 0 }} --on-fail=${{ vars.ON_FAIL }} --on-start=${{ vars.ON_START }} --on-done=${{ vars.ON_DONE }} --max-bookmarks=${{ vars.MAX_BOOKMARKS || 0 }}
2023-03-06 13:42:15 +01:00
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
2023-03-06 13:49:56 +01:00
artifacts
- name: Check out, so that we can keep the workflow alive
uses: actions/checkout@v3
- name: Keep workflow alive
uses: gautamkrishnar/keepalive-workflow@v1