mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 21:19:44 +01:00
Autochangelogs (#17152)
* Scripts ported * Converted changelogs * Fix * Prettier * Removes old unneeded save * Removes very old changelogs
This commit is contained in:
@@ -1,43 +1,24 @@
|
||||
name: Autochangelog
|
||||
# Creates an entry in html/changelogs automatically, to eventually be compiled by compile_changelogs
|
||||
name: Auto Changelog
|
||||
on:
|
||||
pull_request_target:
|
||||
types: closed
|
||||
types:
|
||||
- closed
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
BASENAME: "vorestation"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
autochangelog:
|
||||
name: Autochangelog
|
||||
runs-on: ubuntu-22.04
|
||||
auto_changelog:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.merged == true
|
||||
steps:
|
||||
- uses: /actions/checkout@v3
|
||||
with:
|
||||
ref: master
|
||||
- name: Update repository to master
|
||||
run: git pull "origin" master
|
||||
- name: Ensure +x on CI directory
|
||||
run: |
|
||||
chmod -R +x ./tools/ci
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- name: Generate Changelog
|
||||
run: |
|
||||
pip install pyyaml
|
||||
python tools/GenerateChangelog/ss13_autochangelog.py \
|
||||
html/changelogs \
|
||||
${{ github.event.pull_request.number }} \
|
||||
"${{ github.event.pull_request.user.login }}" \
|
||||
"${{ github.event.pull_request.body }}"
|
||||
python tools/GenerateChangelog/ss13_genchangelog.py \
|
||||
html/changelog.html \
|
||||
html/changelogs
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: Automatic changelog generation for ${{ github.events.pull_request.number }}
|
||||
branch: ${{ github.events.pull_request.base }}
|
||||
commit_user_name: Autochangelog Bot
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Run auto changelog
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const { processAutoChangelog } = await import('${{ github.workspace }}/tools/pull_request_hooks/autoChangelog.js')
|
||||
await processAutoChangelog({ github, context })
|
||||
github-token: ${{ secrets.COMFY_ORANGE_PAT || secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
name: Compile changelogs
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
name: "Compile changelogs"
|
||||
runs-on: ubuntu-24.04
|
||||
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: "Setup python"
|
||||
#if: steps.value_holder.outputs.ACTIONS_ENABLED
|
||||
uses: actions/setup-python@v5
|
||||
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@v4
|
||||
with:
|
||||
fetch-depth: 25
|
||||
persist-credentials: false
|
||||
- name: "Compile"
|
||||
#if: steps.value_holder.outputs.ACTIONS_ENABLED
|
||||
run: |
|
||||
python tools/ss13_genchangelog.py html/changelogs
|
||||
- name: Commit
|
||||
#if: steps.value_holder.outputs.ACTIONS_ENABLED
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "Changelogs"
|
||||
git pull origin master
|
||||
git add html/changelogs
|
||||
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: ${{ secrets.COMFY_ORANGE_PAT || secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user