From 61cae516ec7097f9347e11b1e778001fa70912ca Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 23 Oct 2026 14:49:30 +0800 Subject: ci: trigger Game Mode news after release Dispatch the matching announcement branch after a release is generated. Skip the dispatch until a PAT is configured. --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c662b02..404bdbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -322,3 +322,40 @@ jobs: with: release_tag: ${{ needs.build_push.outputs.release_tag }} handwritten: ${{ inputs.handwritten }} + + kickoff_gamemode_news: + name: Refresh Game Mode announcements + needs: [generate_release] + if: github.ref_name == github.event.repository.default_branch || github.ref_name == 'testing' + runs-on: ubuntu-24.04 + permissions: + contents: read + steps: + - name: Resolve announcement branch + id: target + run: | + branch="${GITHUB_REF_NAME}" + [[ "${branch}" == "main" ]] && branch="stable" + echo "branch=${branch}" >> "$GITHUB_OUTPUT" + + - name: Check dispatch token + id: token + env: + DISPATCH_PAT: ${{ secrets.PAT }} + run: | + if [[ -z "${DISPATCH_PAT}" ]]; then + echo "::warning::Skipping Game Mode announcements dispatch: configure the PAT secret." + echo "available=false" >> "$GITHUB_OUTPUT" + else + echo "available=true" >> "$GITHUB_OUTPUT" + fi + + - name: Kickoff Game Mode announcements + if: steps.token.outputs.available == 'true' + uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4 + continue-on-error: true + with: + token: ${{ secrets.PAT }} + repository: AeroCore-IO/aerocore-os-gamemode-news + event-type: build-announcements + client-payload: '{"branch": "${{ steps.target.outputs.branch }}"}' -- cgit v1.2.3