Compile changelogs #50
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: Compile changelogs | |
permissions: | |
contents: read | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: # allows this workflow to be manually triggered | |
jobs: | |
CompileCL: | |
permissions: | |
contents: write # required to push the updated changelog commit | |
runs-on: ubuntu-latest | |
if: github.repository == 'Baystation12/Baystation12' # to prevent this running on forks | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
with: | |
fetch-depth: 0 # Otherwise, we will fail to push refs | |
ref: dev | |
token: ${{ secrets.BOT_TOKEN }} | |
- name: Python setup | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 | |
with: | |
python-version: '3.x' | |
- name: Install depends | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyyaml bs4 | |
- name: Compile CL | |
run: | | |
python tools/changelog/ss13_genchangelog.py html/changelog.html html/changelogs | |
- name: Commit And Push | |
run: | | |
git config --global user.email "${{ secrets.BOT_EMAIL }}" | |
git config --global user.name "${{ secrets.BOT_NAME }}" | |
git diff --quiet --exit-code && echo "No changes found, abort." && exit 0 | |
git commit -m "Automatic changelog generation [ci skip]" -a | |
git push |