diff options
| -rw-r--r-- | .github/workflows/build.yml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d49d506..ffa1165 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 }}"}' |
