From 3007a802554442ecb5f99d5fa03e1c7c0cc6e291 Mon Sep 17 00:00:00 2001 From: Martin Konstantin Herrmann Date: Wed, 11 Nov 2026 01:16:04 +0100 Subject: [PATCH 1/2] Open a PR when wow-ui-testing has a newer release The Upstream workflow bumps .wut-version to the newest v* tag of voshond/wow-ui-testing and opens a PR. UPSTREAM_TOKEN now also needs Contents and Pull requests write. --- .github/workflows/upstream.yml | 37 ++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index ff01de3..01c8f7f 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -3,10 +3,12 @@ name: Upstream # Weekly drift check against the pinned libraries, tracked in one issue: # library updates also need scripts/fetch-libs.sh and a manual review. The # Blizzard Forever UI source is pinned and tracked by the wow-ui-testing -# library; a new client build arrives here as a .wut-version bump. +# library; a newer library release becomes a .wut-version pull request (the +# test suite reviews it). # # Requires the UPSTREAM_TOKEN secret: a fine-grained token for this -# repository with Contents read and Issues read/write. +# repository with Contents, Pull requests and Issues read/write. Pull requests +# opened with it trigger the test suite, unlike GITHUB_TOKEN. on: schedule: - cron: '0 6 * * 1' @@ -63,3 +65,34 @@ jobs: elif [ -n "$issue" ]; then gh issue close "$issue" --comment 'All pinned libraries match upstream again.' fi + - name: Propose the newest wow-ui-testing release + run: | + repository=voshond/wow-ui-testing + pinned="$(grep -v '^[[:space:]]*\(#\|$\)' .wut-version | head -n 1 | awk '{ print $1 }')" + refs="$(git ls-remote --tags "https://github.com/$repository.git")" + tag="$(sed -n 's|.*refs/tags/\(v[0-9]*\.[0-9]*\.[0-9]*\)$|\1|p' <<<"$refs" | sort -V | tail -n 1)" + if [ -z "$tag" ]; then + echo "::error::No release tags in $repository." + exit 1 + fi + latest="$(awk -v ref="refs/tags/$tag^{}" '$2 == ref { print $1 }' <<<"$refs")" + [ -n "$latest" ] || latest="$(awk -v ref="refs/tags/$tag" '$2 == ref { print $1 }' <<<"$refs")" + printf '\n| wow-ui-testing | `%s` | `%s` @ `%s` | %s |\n' "${pinned:0:7}" "$tag" "${latest:0:7}" \ + "$([ "$pinned" = "$latest" ] && echo current || echo behind)" >> "$GITHUB_STEP_SUMMARY" + if [ "$pinned" = "$latest" ]; then exit 0; fi + printf '%s # %s\n' "$latest" "$tag" > .wut-version + branch=upstream/wow-ui-testing + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git switch -c "$branch" + git add .wut-version + git commit -q -m "Bump wow-ui-testing to $tag" \ + -m "Generated by the Upstream workflow from $repository $latest." + git push -q --force origin "$branch" + if [ -z "$(gh pr list --head "$branch" --state open --json number --jq '.[].number')" ]; then + gh pr create --base main --head "$branch" --title "Bump wow-ui-testing to $tag" --body "## Summary + - Pins \`.wut-version\` to $repository \`$tag\` (\`$latest\`). + - The library's pinned Blizzard client source, API snapshot and atlas table come with it. + + Review the [library changes](https://github.com/$repository/compare/$pinned...$latest) and the spell catalogue check. Install and check the client before merging when the build changes behaviour." + fi From 1ddcf1280e8847c0b5eb8b896577f5604df69efe Mon Sep 17 00:00:00 2001 From: Martin Konstantin Herrmann Date: Wed, 11 Nov 2026 02:46:35 +0100 Subject: [PATCH 2/2] Run the upstream workflow with GITHUB_TOKEN Drop UPSTREAM_TOKEN: the repo allows Actions to create PRs, and the job dispatches tests.yml on the bump branch so the required check runs. --- .github/workflows/upstream.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 01c8f7f..e2acdef 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -6,16 +6,19 @@ name: Upstream # library; a newer library release becomes a .wut-version pull request (the # test suite reviews it). # -# Requires the UPSTREAM_TOKEN secret: a fine-grained token for this -# repository with Contents, Pull requests and Issues read/write. Pull requests -# opened with it trigger the test suite, unlike GITHUB_TOKEN. +# Uses GITHUB_TOKEN; the repository allows Actions to create pull requests. +# Pull requests opened with it trigger no workflows, so the job dispatches the +# test suite on the branch itself. on: schedule: - cron: '0 6 * * 1' workflow_dispatch: permissions: - contents: read + contents: write + pull-requests: write + issues: write + actions: write concurrency: group: upstream @@ -27,17 +30,9 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 20 env: - GH_TOKEN: ${{ secrets.UPSTREAM_TOKEN }} + GH_TOKEN: ${{ github.token }} steps: - - name: Require the upstream token - run: | - if [ -z "$GH_TOKEN" ]; then - echo "::error::Add the UPSTREAM_TOKEN repository secret (see the workflow header)." - exit 1 - fi - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - token: ${{ secrets.UPSTREAM_TOKEN }} - name: Install tools run: sudo apt-get update && sudo apt-get install -y luajit python3 curl - name: Fetch pinned libraries @@ -96,3 +91,4 @@ jobs: Review the [library changes](https://github.com/$repository/compare/$pinned...$latest) and the spell catalogue check. Install and check the client before merging when the build changes behaviour." fi + gh workflow run tests.yml --ref "$branch"