gen_posts #158
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
# This is a basic workflow to help you get started with Actions | |
name: AutoPost | |
# Controls when the workflow will run | |
on: | |
repository_dispatch: | |
types: [gen_posts] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
ref: 'main' | |
- name: install dep | |
run: | | |
sudo apt-get update | |
sudo apt-get install bash | |
- name: sync notes | |
run: | | |
git submodule update --remote --rebase | |
- name: Run format script | |
run: | | |
cd notes | |
git diff HEAD^ HEAD | |
git diff HEAD^ HEAD --name-only | |
chmod +x auto_format.sh | |
bash auto_format.sh | |
cd .. | |
# Runs a set of commands using the runners shell | |
- name: Commit changes | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add . | |
git commit -am "Add changes" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.PAT }} | |
branch: main | |