ci: inline shared release automation#30
Conversation
There was a problem hiding this comment.
Pull request overview
Adds repository-local automation scripts and updates GitHub Actions workflows to handle TOC interface version bumps and release changelog generation/packaging without relying on external reusable workflows.
Changes:
- Add
scripts/update_toc_versions.shto fetch Blizzard CDN versions and update## Interface*directives in.tocfiles. - Add
scripts/generate_changelog.shto generate.release/CHANGELOG.mdfor the BigWigs packager pipeline. - Replace external reusable workflows with inline workflow steps; update
.pkgmetato excludescripts/from packaged artifacts.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/update_toc_versions.sh |
New script to fetch interface versions and update TOC directives. |
scripts/generate_changelog.sh |
New script to generate a cleaned changelog for packaging. |
.pkgmeta |
Excludes scripts/ from packaged output (manual changelog remains .release/CHANGELOG.md). |
.github/workflows/toc-update.yml |
New scheduled workflow to run TOC updater and open/update a PR. |
.github/workflows/release.yml |
New release workflow that vendors the changelog script then runs packager. |
.github/workflows/release-pr.yml |
Switches to release-please action for release PR automation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThree reusable workflows were inlined into explicit jobs; two new Bash scripts were added for changelog generation and WoW Interface version updates; and Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as GitHub Actions Runner (workflow)
participant Repo as Repository (checkout)
participant Script as generate_changelog.sh
participant Packager as BigWigsMods/packager@v2
participant GitHubAPI as GitHub API
Runner->>Repo: Checkout helper script & full tag
Runner->>Script: Execute generate_changelog.sh (env: TAG_NAME, GITHUB_REPOSITORY)
Script-->>Runner: Emit changelog file
Runner->>Packager: Invoke packager with GITHUB_REF set to resolved tag
Packager->>GitHubAPI: Upload package / create release artifacts
Packager-->>Runner: Return success/failure
sequenceDiagram
participant Runner as GitHub Actions Runner (toc-update job)
participant Repo as Repository (checkout master)
participant Script as update_toc_versions.sh
participant Blizzard as Blizzard CDN
participant GitHubAPI as GitHub API
Runner->>Repo: Checkout master
Runner->>Script: Execute update_toc_versions.sh (flavors, excludes)
Script->>Blizzard: Fetch interface versions (with retries & cache)
Blizzard-->>Script: Return versions
Script->>Repo: Update .toc Interface directives
Script-->>Runner: Report changed files
Runner->>GitHubAPI: Commit branch, push (force-with-lease)
Runner->>GitHubAPI: Create or update PR and add label (conditional)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
scripts/update_toc_versions.sh (1)
232-236: Drop the unusedHAS_VANILLA_FLAVORflag.It's assigned but never read, so it adds dead state to an already branchy code path.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/update_toc_versions.sh` around lines 232 - 236, Remove the unused HAS_VANILLA_FLAVOR flag: delete its initialization and the branch that sets it inside the loop over the flavors array, leaving only HAS_CLASSIC_FLAVOR logic (the for loop that checks "$f" == "classic" and sets HAS_CLASSIC_FLAVOR). Also search for any other references to HAS_VANILLA_FLAVOR and remove them if present so no dead variable remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/release-pr.yml:
- Around line 15-19: The workflow invoking googleapis/release-please-action@v4
is missing the required issues: write permission; update the workflow's
permissions block (top-level or the job that runs the action) to include
"issues: write" alongside any existing permissions (e.g., contents: write and
pull-requests: write) so the release-please action can label and manage PRs
correctly.
- Around line 15-19: Update the release workflow to stop using GITHUB_TOKEN for
the googleapis/release-please-action and instead use a PAT or GitHub App token
(provide a repository/organization secret like RELEASE_PUBLISH_TOKEN) so tag
pushes created by release-please will trigger downstream workflows; in the
workflow step that calls googleapis/release-please-action@v4, replace token: ${{
secrets.GITHUB_TOKEN }} with token: ${{ secrets.RELEASE_PUBLISH_TOKEN }} (or the
GitHub App secret) and ensure the secret has appropriate repo-scoped
permissions. Also add the missing permission "issues: write" to the workflow
permissions block alongside the existing "contents: write" and "pull-requests:
write" entries so release-please has required access for creating release
issues.
In @.github/workflows/toc-update.yml:
- Around line 17-20: The checkout step uses actions/checkout@v6 which by default
fetches a single commit causing git push --force-with-lease to fail when the
remote branch chore/toc-interface-version exists but has no local
remote-tracking ref; update the Checkout invocation to fetch full history (set
fetch-depth: 0) or add an explicit git fetch of the chore/toc-interface-version
branch before the push so the remote-tracking ref exists, and apply the same
change to the other Checkout usage later in the workflow (the other
actions/checkout@v6 block that precedes the push).
In `@scripts/update_toc_versions.sh`:
- Around line 55-63: The curl call inside the retry loop (where response=$(curl
-sf "$url" 2>/dev/null) && break) can hang indefinitely; update that invocation
to include a per-attempt timeout by adding --connect-timeout and --max-time
flags (use existing or new variables like CONNECT_TIMEOUT and CURL_MAX_TIME if
available) so each attempt is bounded and the loop can retry; keep the rest of
the loop (attempt, MAX_RETRIES, RETRY_DELAY, product, url, response) unchanged.
---
Nitpick comments:
In `@scripts/update_toc_versions.sh`:
- Around line 232-236: Remove the unused HAS_VANILLA_FLAVOR flag: delete its
initialization and the branch that sets it inside the loop over the flavors
array, leaving only HAS_CLASSIC_FLAVOR logic (the for loop that checks "$f" ==
"classic" and sets HAS_CLASSIC_FLAVOR). Also search for any other references to
HAS_VANILLA_FLAVOR and remove them if present so no dead variable remains.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d18435b6-f66b-498d-aa64-b25d1a8b141a
📒 Files selected for processing (6)
.github/workflows/release-pr.yml.github/workflows/release.yml.github/workflows/toc-update.yml.pkgmetascripts/generate_changelog.shscripts/update_toc_versions.sh
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/toc-update.yml (1)
17-20:⚠️ Potential issue | 🟠 MajorShallow clone breaks
--force-with-leaseon subsequent runs.This issue was previously flagged. The default shallow checkout (
fetch-depth: 1) does not fetch the remote-tracking ref forchore/toc-interface-version. On the first run, the branch doesn't exist remotely so the push succeeds. On subsequent runs,--force-with-leasefails with "rejected (stale info)" because the local remote-tracking ref is missing.,
Suggested fix
- name: Checkout uses: actions/checkout@v6 with: ref: master + fetch-depth: 0Or explicitly fetch the branch before pushing:
git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git fetch origin "$BRANCH:refs/remotes/origin/$BRANCH" 2>/dev/null || true git checkout -B "$BRANCH"Also applies to: 51-56
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/toc-update.yml around lines 17 - 20, The checkout step uses a shallow clone which omits remote-tracking refs and causes --force-with-lease to fail; update the Checkout step that uses actions/checkout@v6 (the step named "Checkout") to perform a full clone by adding with: fetch-depth: 0 (or remove the shallow option), or alternatively ensure you explicitly fetch the target branch before pushing (e.g., run git fetch origin chore/toc-interface-version) so the remote-tracking ref exists; apply the same change to the other checkout occurrence that also uses actions/checkout@v6.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/toc-update.yml:
- Line 53: Replace the quoted glob so the shell can expand it: change the
command `git add -A '*.toc'` to `git add -A *.toc` (or alternatively use an
explicit Git pathspec like `git add -- '*.toc'` if you want Git to interpret the
pattern); update the line containing `git add -A '*.toc'` to one of these
unquoted/explicit forms so `.toc` files are staged as intended.
---
Duplicate comments:
In @.github/workflows/toc-update.yml:
- Around line 17-20: The checkout step uses a shallow clone which omits
remote-tracking refs and causes --force-with-lease to fail; update the Checkout
step that uses actions/checkout@v6 (the step named "Checkout") to perform a full
clone by adding with: fetch-depth: 0 (or remove the shallow option), or
alternatively ensure you explicitly fetch the target branch before pushing
(e.g., run git fetch origin chore/toc-interface-version) so the remote-tracking
ref exists; apply the same change to the other checkout occurrence that also
uses actions/checkout@v6.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 39c356e7-99ee-44a4-8e18-d171aa08ad15
📒 Files selected for processing (3)
.github/workflows/release-pr.yml.github/workflows/release.yml.github/workflows/toc-update.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/release-pr.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary
Summary by CodeRabbit