Skip to content

Announce Wurst 7.47.3 update on WurstForum #7

Announce Wurst 7.47.3 update on WurstForum

Announce Wurst 7.47.3 update on WurstForum #7

name: Announce Wurst Update
run-name: Announce Wurst ${{ github.event.inputs.wurst_version }} update on WurstForum
on:
workflow_dispatch:
inputs:
wurst_version:
description: "Wurst version (without v or -MC)"
required: true
dry_run:
description: "Don't actually upload the announcement"
type: boolean
default: false
distinct_id:
description: "Automatically set by the return-dispatch action (leave blank if running manually)"
required: false
permissions:
# To push the automated commit.
contents: write
# To trigger the Jekyll workflow.
actions: write
jobs:
announce:
runs-on: ubuntu-latest
steps:
- name: Echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: _scripts/requirements.txt
- name: Install dependencies
run: |
pip install -r _scripts/requirements.txt
- name: Run announce_wurst_update.py
id: announce
env:
WURSTFORUM_TOKEN: ${{ secrets.WF_BOT_TOKEN }}
run: |
python _scripts/announce_wurst_update.py \
"${{ github.event.inputs.wurst_version }}" \
${{ github.event.inputs.dry_run == 'true' && '--dry-run' || '' }}
- name: Commit changes
if: ${{ github.event.inputs.dry_run != 'true' }}
run: |
WURST_VERSION=${{ github.event.inputs.wurst_version }}
DISCUSSION_ID=${{ steps.announce.outputs.discussion_id }}
git config --local user.email "[email protected]"
git config --local user.name "Wurst-Bot"
git add .
git commit -m "[Wurst-Bot] Link Wurst $WURST_VERSION post to WF thread $DISCUSSION_ID"
git push
- name: Trigger Jekyll workflow
if: ${{ github.event.inputs.dry_run != 'true' }}
id: jekyll_dispatch
uses: codex-/return-dispatch@v2
with:
token: ${{ github.token }}
owner: Wurst-Imperium
repo: WurstClient.net
ref: gh-pages
workflow: jekyll.yml
- name: Wait for Jekyll workflow to finish (run ${{ steps.jekyll_dispatch.outputs.run_id }})
if: ${{ github.event.inputs.dry_run != 'true' }}
uses: codex-/await-remote-run@v1
with:
token: ${{ github.token }}
owner: Wurst-Imperium
repo: WurstClient.net
run_id: ${{ steps.jekyll_dispatch.outputs.run_id }}
run_timeout_seconds: 300 # 5 minutes