Run retooter periodically (every 15 min) or manually #49278
This file contains hidden or 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
| # vim: set tabstop=2 softtabstop=2 shiftwidth=2 expandtab: | |
| name: Run retooter periodically (every 15 min) or manually | |
| on: | |
| schedule: | |
| - cron: '*/15 * * * *' | |
| workflow_dispatch: | |
| concurrency: ${{ github.workflow }} | |
| jobs: | |
| retoot: | |
| name: Repost toots | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
| - uses: actions/cache@v3 | |
| id: restore-cache | |
| with: | |
| key: ${{ github.repository }}-${{ env.TODAY }}-${{ github.sha }} | |
| path: | | |
| since_id | |
| ~/.cache/pip/ | |
| ~/.local/lib/python*/site-packages | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - run: pip install --user . | |
| if: steps.restore-cache.outputs.cache-hit != 'true' | |
| - run: python -m retooter | |
| env: | |
| RETOOTER_ACCOUNT_NAME: ${{ vars.RETOOTER_ACCOUNT_NAME }} | |
| RETOOTER_ALLOWED_ACCOUNTS: ${{ vars.RETOOTER_ALLOWED_ACCOUNTS }} | |
| RETOOTER_API_BASE_URL: ${{ vars.RETOOTER_API_BASE_URL }} | |
| RETOOTER_DRY_RUN: ${{ vars.RETOOTER_DRY_RUN }} | |
| ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
| CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
| CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} |