Weekly Substack mirror #2
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
| name: Weekly Substack mirror | |
| on: | |
| schedule: | |
| - cron: "17 9 * * 1" | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| jobs: | |
| mirror: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install adapter | |
| run: python -m pip install git+https://github.com/Marvin-The-Bodega-Cat/substack-block-adapter.git@v0.2.0 | |
| - name: Update mirror | |
| run: substack-block watch --config substack-block.toml | |
| - name: Commit mirror changes | |
| run: | | |
| if git diff --quiet; then | |
| echo "No Substack changes detected. Beige, but honest." | |
| else | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "chore: update Substack mirror" | |
| git push | |
| fi |