Skip to content

fix(publish): keep newest result artifact when a publish job is restarted - #244

Merged
felickz merged 1 commit into
mainfrom
felickz/publish-summary-newest-artifact
Oct 28, 2026
Merged

felickz merged 1 commit into
mainfrom
felickz/publish-summary-newest-artifact

Conversation

@felickz

@felickz felickz commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What

The Publish summary job now downloads only the newest result artifact per name, instead of using actions/download-artifact with merge-multiple: true.

Why

Cancelling and restarting a publish job leaves two artifacts with the same name in the run (for example publish-result-csharp-src). merge-multiple extracts all matches into one directory in no guaranteed order, so the stale failed fragment from the cancelled attempt overwrote the newer published one.

Observed on the v0.8.3 release: the C# and Go query packs were published (0.8.3 is present in GHCR), but the release notes table showed "publish failed (still 0.8.2)" for both. The two artifacts per pack were:

Pack Cancelled attempt Restarted attempt
codeql-csharp-queries failed (19:23:35Z) published (19:33:23Z)
codeql-go-queries failed (19:23:30Z) published (19:28:35Z)

Changes

  • New .github/scripts/download-latest-publish-results.sh <run-id> <dest-dir>: lists the run's publish-result-* artifacts via the API, keeps the newest non-expired one per name, and extracts them into a flat directory. It also works locally (uses gh auth), so a summary can be rebuilt for a past run while its artifacts are still within the 1 day retention.
  • publish.yml summary job: uses the script (still continue-on-error: true) and adds actions: read, which listing artifacts through GITHUB_TOKEN requires.

Testing

Ran the script against the affected run, rebuilt the summary with build-publish-summary.sh, and upserted it into the v0.8.3 release with upsert-release-table.sh. 20 fragments were downloaded, no publish failed cells remain, and both marker blocks in the release body are intact.

Scope note: this does not change how the release or tag is created.

…rted

When a publish job is cancelled and restarted, the run ends up with two
artifacts with the same name (for example publish-result-csharp-src). The
summary job downloaded them with merge-multiple, which extracts every match
into one directory in no guaranteed order, so the stale "failed" fragment
overwrote the newer "published" one. The release notes then showed
"publish failed" for packs that had published (seen on v0.8.3 for the C# and
Go query packs).

Replace the download step with download-latest-publish-results.sh, which lists
the run's artifacts via the API and downloads only the newest non-expired one
per name. The summary job needs actions: read for that listing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change to use the latest publish results after job restarts.

No open issues 🎉

What changed in this PR

This PR makes publish summaries use the newest result for each pack after a job is restarted, preventing older failure results from overwriting newer successful results.

Changes:

  • Adds a script that selects the newest non-expired artifact per publish-result-* name and extracts the results into one directory.
  • Updates the summary job to use the script with actions: read permission, while retaining continue-on-error: true.
File Description
.github/​workflows/​publish.yml Uses the new downloader and grants permission to read artifacts.
.github/​scripts/​download-latest-publish-results.sh Selects and downloads the newest non-expired publish result per artifact name.

Review effort: Balanced

@felickz
felickz merged commit c415c1a into main Oct 28, 2026
24 checks passed
@felickz
felickz deleted the felickz/publish-summary-newest-artifact branch October 28, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants