Weekly Update #2
This file contains 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 Update | |
on: | |
schedule: | |
- cron: "0 0 * * 0" | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Set up Emacs | |
uses: purcell/setup-emacs@master | |
with: | |
version: 29.4 | |
# apparently comes with requests pre-installed | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- uses: actions/checkout@v4 | |
- name: Find new posts | |
run: python3 bin/run.py --skip-pushing | |
env: | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
- name: Export org to markdown | |
run: emacs --batch -l bin/convert-to-md.el out.org | |
- name: Commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "emacs-reddit-tips-n-tricks-bot" | |
git add *.org *.md comments.json | |
git commit -m "Weekly update from $(date +%Y-%m-%d)" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: master |