Skip to content

Instantly share code, notes, and snippets.

@fdch
Created January 20, 2022 14:16
Show Gist options
  • Save fdch/23fd4077d9b8be0bf017ec420e13add5 to your computer and use it in GitHub Desktop.
Save fdch/23fd4077d9b8be0bf017ec420e13add5 to your computer and use it in GitHub Desktop.
Github Action to update and commit a file with a python script on every push.
name: Auto-update posts
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setting up python
uses: actions/setup-python@v2
with:
python-version: 3.9.7
- name: Updating posts
run: |
python update_posts.py
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Auto-Update posts"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment