From d237c0c90ea016d64468f65e9c6ea36153f332a2 Mon Sep 17 00:00:00 2001 From: Joshua Hale Date: Wed, 1 Apr 2026 12:27:06 +0100 Subject: [PATCH] Skip coverage upload for merge queue runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge queue commits are ephemeral — coverage was already uploaded during the PR, and the push to the default branch will upload results for the final landed commit. Log a warning and exit successfully instead of wasting an API call. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 1 + action.yml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 824db68..457d685 100644 --- a/README.md +++ b/README.md @@ -104,3 +104,4 @@ The repository must have the following feature flags enabled: ## Caveats - **Fork PRs are not supported.** Pull requests from forks don't have write access to the base repository, so the action cannot upload coverage. When a fork PR is detected, the action exits gracefully with a notice — it won't fail your CI. +- **Merge queue runs are skipped.** Coverage should be uploaded for PRs and the default branch, making merge queue uploads unnecessary. The action logs a warning and exits successfully. diff --git a/action.yml b/action.yml index 3b7037e..4893c98 100644 --- a/action.yml +++ b/action.yml @@ -34,6 +34,14 @@ runs: exit 1 fi + # Skip coverage upload for merge queue runs — coverage should be + # uploaded for PRs and the default branch, making merge queue + # uploads unnecessary. + if [ "${{ github.event_name }}" = "merge_group" ]; then + echo "::warning::Skipping coverage upload for merge queue. Configure your workflow to upload coverage for PRs and the default branch instead. To avoid spinning up a runner, add \"if: github.event_name != 'merge_group'\" to the upload job." + exit 0 + fi + # Skip coverage upload for fork PRs — the token won't have write # permissions to the base repository. if [ "${{ github.event.pull_request.head.repo.full_name }}" != "" ] && \