Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

The auto-assign workflow fails on fork PRs with Resource not accessible by integration because GITHUB_TOKEN lacks write permissions for security reasons.

Changes

  • Added conditional to skip workflow for fork PRs while preserving functionality for same-repo PRs and issues
  • Used short-circuit evaluation with explicit null check to prevent runtime errors
jobs:
  run:
    runs-on: ubuntu-latest
    if: github.event_name == 'issues' || (github.event.pull_request != null && github.event.pull_request.head.repo.full_name == github.repository)
    permissions:
      issues: write
      pull-requests: write

The workflow now runs only when GITHUB_TOKEN has sufficient permissions: issues and non-fork pull requests.

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix the auto-assign issue</issue_title>
<issue_description>The failure is per: https://github.com/Umplify/xunit-dependency-injection/actions/runs/20273296887/job/58220115395?pr=337</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix the auto-assign issue Fix auto-assign workflow for pull requests from forks Dec 16, 2025
@Arash-Sabet Arash-Sabet marked this pull request as ready for review December 16, 2025 16:27
Copilot AI review requested due to automatic review settings December 16, 2025 16:27
Copilot AI requested a review from Arash-Sabet December 16, 2025 16:27
Copy link
Contributor

Copilot AI left a comment

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 fixes the auto-assign workflow that was failing on pull requests from forks due to insufficient GITHUB_TOKEN permissions. The workflow now includes a conditional check to skip execution for fork PRs while maintaining functionality for issues and same-repository pull requests.

Key Changes:

  • Added conditional logic to prevent workflow execution on fork PRs
  • Used explicit null check with short-circuit evaluation for safe property access
  • Preserved existing functionality for issues and non-fork PRs

@Arash-Sabet Arash-Sabet added the bug Something isn't working label Dec 16, 2025
@Arash-Sabet Arash-Sabet merged commit 41efc0d into main Dec 16, 2025
1 check passed
@Arash-Sabet Arash-Sabet deleted the copilot/fix-auto-assign-issue branch December 16, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the auto-assign issue

2 participants