Skip to content

Compile changelogs #484

Compile changelogs

Compile changelogs #484

name: Compile changelogs
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
compile:
name: "Compile changelogs"
runs-on: ubuntu-latest
steps:
- name: "Check for ACTION_ENABLER secret and pass true to output if it exists to be checked by later steps"
id: value_holder
env:
ENABLER_SECRET: ${{ secrets.ACTION_ENABLER }}
run: |
unset SECRET_EXISTS
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
echo "ACTIONS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
- name: Generate App Token
id: app-token-generation
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: "Setup python"
if: steps.value_holder.outputs.ACTIONS_ENABLED
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: "Install deps"
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
python -m pip install --upgrade pip
python -m pip install pyyaml
sudo apt-get install dos2unix
- name: "Checkout"
if: steps.value_holder.outputs.ACTIONS_ENABLED
uses: actions/checkout@v3
with:
fetch-depth: 25
persist-credentials: false
token: ${{ steps.app-token-generation.outputs.token }}
- name: "Compile"
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
python .github/ss13_genchangelog.py html/changelogs
- name: Commit
if: steps.value_holder.outputs.ACTIONS_ENABLED
run: |
git config --local user.email "${{ secrets.APP_PUBLIC_ID }}+${{ secrets.APP_PUBLIC_NAME }}[bot]@users.noreply.github.com"
git config --local user.name "${{ secrets.APP_PUBLIC_NAME }}[bot]"
git pull origin master
git add html/changelogs/archive
git commit -m "Automatic changelog compile [ci skip]" -a || true
- name: "Push"
if: steps.value_holder.outputs.ACTIONS_ENABLED
uses: ad-m/github-push-action@master
with:
github_token: ${{ steps.app-token-generation.outputs.token }}