Skip to content

Skip test report check creation for fork PRs - #689

Closed
Brad Flood (brflood) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-actions-build-job
Closed

Brad Flood (brflood) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-github-actions-build-job

Conversation

Copilot AI commented Sep 14, 2026

Copy link
Copy Markdown

Description

The build (8.0.x) job failed after successful build, test, and CodeQL steps because dorny/test-reporter attempted to create a check run from a forked pull_request, where GITHUB_TOKEN cannot write checks.

  • Root cause

    • Fork PR runs receive restricted token permissions.
    • The Test Report step requires checks: write at runtime to create the DotNet Tests check run.
  • Change

    • Gate the Test Report step to run only when check creation is permitted:
      if: ${{ (success() || failure()) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
    • Same-repo PRs, pushes, schedules, and manual runs still publish test reports.
    • Fork PRs still build and test, but skip check-run publishing.

Checklist

  • The code change is covered by unit tests. I have added tests that prove my fix is effective or that my feature works
  • I have performed end-to-end test locally.
  • New and existing unit tests pass locally with my changes
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I used clear names for everything
  • I have performed a self-review of my own code

Co-authored-by: brflood <63075802+brflood@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job build (8.0.x) Skip test report check creation for fork PRs Sep 14, 2026
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.

2 participants