From 6116b0256b5498d17e1a957b86fad36deeffa01e Mon Sep 17 00:00:00 2001 From: Timothy Quilling Date: Sat, 8 Jul 2023 23:56:38 -0400 Subject: [PATCH] chore: split external token workflow --- .github/workflows/get_context.yml | 2 +- .github/workflows/get_context_with_tokens.yml | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/get_context_with_tokens.yml diff --git a/.github/workflows/get_context.yml b/.github/workflows/get_context.yml index 4b8c5bd3..b379ae89 100644 --- a/.github/workflows/get_context.yml +++ b/.github/workflows/get_context.yml @@ -30,7 +30,7 @@ jobs: path: artifacts - name: Get Directory structure run: ls -lR - - run: python find_posts.py --lock-hours=0 --access-token=${{ secrets.ACCESS_TOKEN }} -c="./config.json" --external-tokens=${{ secrets.EXTERNAL_TOKENS }} + - run: python find_posts.py --lock-hours=0 --access-token=${{ secrets.ACCESS_TOKEN }} -c="./config.json" - name: Upload artifacts uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/get_context_with_tokens.yml b/.github/workflows/get_context_with_tokens.yml new file mode 100644 index 00000000..7477759a --- /dev/null +++ b/.github/workflows/get_context_with_tokens.yml @@ -0,0 +1,43 @@ +name: Get context with tokens +concurrency: get_context + +on: + workflow_dispatch: + schedule: + - cron: '3,13,23,33,43,53 * * * *' + +jobs: + run: + runs-on: ubuntu-latest + environment: mastodon + steps: + - name: Checkout original repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'pip' # caching pip dependencies + - run: pip install -r requirements.txt + - name: Download all workflow run artifacts + uses: dawidd6/action-download-artifact@v2 + with: + name: artifacts + workflow: get_context.yml + if_no_artifact_found: warn + path: artifacts + - name: Get Directory structure + run: ls -lR + - run: python find_posts.py --lock-hours=0 --access-token=${{ secrets.ACCESS_TOKEN }} -c="./config.json" --external-tokens=${{ secrets.EXTERNAL_TOKENS }} + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: | + artifacts + - name: Checkout user's forked repository for keeping workflow alive + uses: actions/checkout@v3 + - name: Keep workflow alive + uses: gautamkrishnar/keepalive-workflow@v1