Skip to content

Fix block-remove-before-merge workflow failing on merge_group events#1798

Merged
edburns merged 2 commits into
mainfrom
copilot/fix-block-remove-before-merge-workflow
Jun 25, 2026
Merged

Fix block-remove-before-merge workflow failing on merge_group events#1798
edburns merged 2 commits into
mainfrom
copilot/fix-block-remove-before-merge-workflow

Conversation

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

On merge_group events, github.event.pull_request.number is empty, causing gh api repos/$REPO/pulls//files to 404 and fail the job unconditionally — regardless of whether any remove-before-merge directories exist. This is latent today (merge queue not enabled), but would block every merge queue entry if it were.

Change

Added a job-level condition to skip the check on non-PR events:

jobs:
  check-paths:
    if: github.event_name == 'pull_request'

The check remains fully effective on pull_request events. On merge_group events the job skips (treated as passing by GitHub's required-status-check logic), which is correct — a PR must have already passed the check before entering the queue.

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix block-remove-before-merge workflow failure on merge_group events Fix block-remove-before-merge workflow failing on merge_group events Jun 25, 2026
Copilot AI requested a review from edburns June 25, 2026 14:40
@edburns edburns marked this pull request as ready for review June 25, 2026 15:39
@edburns edburns requested a review from a team as a code owner June 25, 2026 15:39
Copilot AI review requested due to automatic review settings June 25, 2026 15:39
@edburns edburns merged commit ef2bb93 into main Jun 25, 2026
12 checks passed
@edburns edburns deleted the copilot/fix-block-remove-before-merge-workflow branch June 25, 2026 15:39

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.

Pull request overview

This PR prevents the “Block remove-before-merge paths” workflow from failing on merge_group events by skipping the job when the event payload does not include a PR number. This avoids unconditional 404s from the gh api repos/$REPO/pulls/$PR_NUMBER/files call while keeping the enforcement intact for normal PR activity.

Changes:

  • Add a job-level if guard so the check runs only for pull_request events.
  • Ensure merge_group workflow runs are treated as passing by skipping the job rather than failing on missing PR context.
Show a summary per file
File Description
.github/workflows/block-remove-before-merge.yml Adds a job-level condition to skip the PR-files check on non-PR events (notably merge_group).

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@rotationtv1-crypto rotationtv1-crypto left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

copilot/fix-block-remove-before-merge-workflow

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.

4 participants