Skip to content

ci: fix workflows that always fail for fork PRs#5065

Open
jamescrosswell wants to merge 1 commit intomainfrom
external-contributors-5062
Open

ci: fix workflows that always fail for fork PRs#5065
jamescrosswell wants to merge 1 commit intomainfrom
external-contributors-5062

Conversation

@jamescrosswell
Copy link
Copy Markdown
Collaborator

@jamescrosswell jamescrosswell commented Mar 26, 2026

Fixes #5062:

Two CI workflows failed whenever a PR came from a fork because the pull_request trigger runs in a sandboxed context with no write access and no secrets:

  • Changelog Preview: switched pull_request → pull_request_target so the workflow runs in the base repo context and can post PR comments. Also tightened permissions from contents:write to contents:read since the workflow only needs to write to pull-requests.

  • Format Code: pull_request_target cannot push to a fork branch anyway, so the fix is fork-aware logic in the commit step. For fork PRs, formatting issues fail the check with a clear message telling the contributor which dotnet format command to run locally. Internal PR behaviour (auto-commit and push) is unchanged.

Warden was also failing but is already resolved — warden.yml was removed because Warden is now a globally-enabled GitHub App with its own credentials, unaffected by fork PR restrictions.

Testing

Tested here:

Pushed from my own private fork of the Sentry repo.

Two CI workflows failed whenever a PR came from a fork because the
pull_request trigger runs in a sandboxed context with no write access
and no secrets:

- Changelog Preview: switched pull_request → pull_request_target so the
  workflow runs in the base repo context and can post PR comments.
  Also tightened permissions from contents:write to contents:read since
  the workflow only needs to write to pull-requests.

- Format Code: pull_request_target cannot push to a fork branch anyway,
  so the fix is fork-aware logic in the commit step. For fork PRs,
  formatting issues fail the check with a clear message telling the
  contributor which dotnet format command to run locally. Internal PR
  behaviour (auto-commit and push) is unchanged.

Warden was also listed as failing but is already resolved — warden.yml
was removed because Warden is now a globally-enabled GitHub App with
its own credentials, unaffected by fork PR restrictions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.13%. Comparing base (bcc6476) to head (88fa6ac).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5065      +/-   ##
==========================================
+ Coverage   74.01%   74.13%   +0.12%     
==========================================
  Files         499      499              
  Lines       18065    18066       +1     
  Branches     3518     3518              
==========================================
+ Hits        13370    13393      +23     
+ Misses       3836     3812      -24     
- Partials      859      861       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell jamescrosswell marked this pull request as ready for review March 26, 2026 03:18
jamescrosswell added a commit that referenced this pull request Mar 26, 2026
jamescrosswell added a commit to jamescrosswell/sentry-dotnet that referenced this pull request Mar 26, 2026
jamescrosswell added a commit to jamescrosswell/sentry-dotnet that referenced this pull request Mar 26, 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.

Some CI workflows always fail for external contributors

1 participant