Skip to content

fix: agents-verifier.yml fails to detect merged PRs when label added #950

Description

@stranske

Problem

The verify:compare (and other verify:*) labels don't trigger the verifier workflow on merged PRs when added after the PR is merged.

Root cause: The pull_request_target event with labeled type doesn't reliably include .merged in the event payload for already-merged PRs. The workflow checks:

const pr = context.payload.pull_request;
  core.info('PR not merged; skipping verifier.');

Evidence

PR stranske/Manager-Database#135 has verify:compare label but verifier runs show:

PR not merged; skipping verifier.

Yet the PR was merged on Jan 11, 2026.

Fix

Fetch fresh PR data from the API for the pull_request_target trigger, similar to the workflow_dispatch path which already does this correctly:

// Fetch fresh PR data from API
const { data: pr } = await github.rest.pulls.get({
  ...context.repo,
  pull_number: payloadPr.number,
});

  ...
}

Affected files

  • .github/workflows/agents-verifier.yml (both in Workflows repo and consumer repos)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentsAgent-related issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions