Skip to content

fix(gha): switch to eps1lon action and fix fork PR failures - #2748

Merged
FonduemangVI merged 1 commit into
TRaSH-Guides:masterfrom
rcdailey:fix/conflicts-workflow-fork-permissions
May 21, 2026
Merged

fix(gha): switch to eps1lon action and fix fork PR failures#2748
FonduemangVI merged 1 commit into
TRaSH-Guides:masterfrom
rcdailey:fix/conflicts-workflow-fork-permissions

Conversation

@rcdailey

@rcdailey rcdailey commented May 21, 2026

Copy link
Copy Markdown
Contributor

The Label Conflicts workflow was failing on fork-based PRs (like #2740) because GitHub restricts GITHUB_TOKEN to read-only on pull_request events from forks, regardless of what the workflow declares.

The mschilde/auto-label-merge-conflicts action scans all open PRs for merge conflicts on every run. When it found a conflicted PR and tried to call the addLabelsToLabelable GraphQL mutation, it hit:

addLabelsToLabelable request failed: GraphqlError: Resource not accessible by integration

Previous runs on the same branch "passed" only because no PRs had conflicts at the time, so the mutation was never called.

Changes:

  • Replaced mschilde/auto-label-merge-conflicts (dormant since 2020) with eps1lon/actions-label-merge-conflict@v3.0.3, which is actively maintained and handles this case
  • Scoped push trigger to master only (feature branch pushes can't create conflicts in other PRs)
  • Added pull_request_target: [synchronize] so the conflict label gets removed when authors rebase (safe because the workflow never checks out PR code)
  • Removed the redundant pull_request trigger that caused the fork failures

Summary by Sourcery

Update the merge-conflict labeling workflow to use a maintained action and avoid fork-related permission failures.

CI:

  • Replace the deprecated auto-label merge conflicts action with eps1lon/actions-label-merge-conflict in the conflicts workflow.
  • Restrict the conflicts workflow push trigger to the master branch and handle PR updates via pull_request_target synchronize events.
  • Adjust workflow conditions and inputs to prevent failures on fork-based pull requests while preserving conflict labeling behavior.

The mschilde/auto-label-merge-conflicts action used pull_request events,
which give read-only tokens for fork PRs, causing conflict labeling to
fail silently. The eps1lon/actions-label-merge-conflict action uses
pull_request_target (no code checkout, so safe) and supports removing
the conflict label when authors rebase.

- Replace mschilde/auto-label-merge-conflicts@v2.0 with eps1lon/actions-
  label-merge-conflict@v3.0.3
- Switch trigger from pull_request to pull_request_target with
  synchronize type
- Scope push trigger to master branch since only base branch changes
  create conflicts
- Move fork guard to job-level if condition
- Update input names to dirtyLabel and repoToken per new action API
@github-actions github-actions Bot added Area: github_actions Github Actions Related Area: Backend Backend Changes, not related to a specific section labels May 21, 2026
@rcdailey
rcdailey marked this pull request as ready for review May 21, 2026 15:02
@sourcery-ai

sourcery-ai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the Label Conflicts GitHub Actions workflow to use a maintained action, tighten triggers, and centralize fork-handling logic so conflict labels work reliably, including for fork-based PRs, without unsafe permissions.

Flow diagram for updated conflicts CI workflow

flowchart LR
  A[push on master] --> C{repository.fork == false}
  B[pull_request_target synchronize] --> C
  C --> D[triage job]
  D --> E[eps1lon/actions-label-merge-conflict]
  E --> F[apply Status: Conflicted label via repoToken]
Loading

File-Level Changes

Change Details Files
Update the conflicts-labeling workflow to use eps1lon/actions-label-merge-conflict with the appropriate inputs and job-level fork guard.
  • Replace mschilde/auto-label-merge-conflicts v2 with eps1lon/actions-label-merge-conflict v3.0.3 in the triage job step
  • Update action inputs to use dirtyLabel and repoToken instead of the old CONFLICT_LABEL_NAME, GITHUB_TOKEN, MAX_RETRIES, and WAIT_MS inputs
  • Move the fork-check condition from the step level to a job-level if: github.event.repository.fork == false guard
.github/workflows/conflicts.yml
Tighten workflow triggers to avoid unsafe or unnecessary runs, including for fork-based pull requests.
  • Restrict push trigger to the master branch only
  • Replace the previous pull_request trigger with a pull_request_target trigger limited to synchronize events, with a comment documenting why this is safe
  • Remove the redundant pull_request trigger that caused failures on fork-based PRs
.github/workflows/conflicts.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@rcdailey
rcdailey requested a review from FonduemangVI May 21, 2026 15:02
@rcdailey rcdailey changed the title ci(conflicts): switch to eps1lon action and fix fork PR failures fix(gha): switch to eps1lon action and fix fork PR failures May 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Deploying with ⚡ Cloudflare Pages

Latest commit:3664b0561f24bd448d80d21e57f71ecd257e5a00
Status: ✅  Deploy successful!
Preview URL:https://51ef6771.trash-guides-6xu.pages.dev
Branch Preview URL:https://pr-2748.trash-guides-6xu.pages.dev

@sourcery-ai sourcery-ai Bot 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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@FonduemangVI
FonduemangVI merged commit 9fe0793 into TRaSH-Guides:master May 21, 2026
8 of 10 checks passed
@rcdailey
rcdailey deleted the fix/conflicts-workflow-fork-permissions branch June 7, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Backend Backend Changes, not related to a specific section Area: github_actions Github Actions Related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants