Skip to content

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

Merged
jamescrosswell merged 1 commit intomainfrom
external-contributors-5062
Mar 30, 2026
Merged

ci: fix workflows that always fail for fork PRs#5065
jamescrosswell merged 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 20 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
Copy link
Copy Markdown
Member

@Flash0ver Flash0ver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🥔

if [[ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
if [[ $(git status) != *"nothing to commit"* ]]; then
echo "::error::Formatting issues found. Please run the following command locally and push the result:"
echo "::error:: dotnet format Sentry.slnx --no-restore --exclude ./modules ./**/*OptionsSetup.cs ./test/Sentry.Tests/AttributeReaderTests.cs"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@jamescrosswell jamescrosswell merged commit 9e3113e into main Mar 30, 2026
38 checks passed
@jamescrosswell jamescrosswell deleted the external-contributors-5062 branch March 30, 2026 22:21
irvinesunday added a commit to irvinesunday/Hali that referenced this pull request Apr 8, 2026
Updated [Sentry.AspNetCore](https://github.com/getsentry/sentry-dotnet)
from 6.3.0 to 6.3.1.

<details>
<summary>Release notes</summary>

_Sourced from [Sentry.AspNetCore's
releases](https://github.com/getsentry/sentry-dotnet/releases)._

## 6.3.1

### Fixes 🐛

- fix: Workaround FileNotFoundException on Android when recovering
sessions by @​jamescrosswell in
[#​5084](getsentry/sentry-dotnet#5084)
- fix: `CaptureFeedback` now supports multiple attachments correctly by
@​bitsandfoxes in
[#​5077](getsentry/sentry-dotnet#5077)

### Dependencies ⬆️

#### Deps

- chore(deps): update Native SDK to v0.13.5 by @​github-actions in
[#​5119](getsentry/sentry-dotnet#5119)
- chore(deps): update CLI to v3.3.5 by @​github-actions in
[#​5093](getsentry/sentry-dotnet#5093)
- chore(deps): update Native SDK to v0.13.4 by @​github-actions in
[#​5081](getsentry/sentry-dotnet#5081)
- chore(deps): update Java SDK to v8.37.1 by @​github-actions in
[#​5071](getsentry/sentry-dotnet#5071)
- chore(deps): update CLI to v3.3.4 by @​github-actions in
[#​5068](getsentry/sentry-dotnet#5068)
- chore(deps): update Java SDK to v8.37.0 by @​github-actions in
[#​5069](getsentry/sentry-dotnet#5069)
- chore(deps): update Cocoa SDK to v9.8.0 by @​github-actions in
[#​5044](getsentry/sentry-dotnet#5044)
- chore(deps): update Java SDK to v8.36.0 by @​github-actions in
[#​5036](getsentry/sentry-dotnet#5036)
- chore(deps): update epitaph to 0.1.1 by @​github-actions in
[#​5036](getsentry/sentry-dotnet#5036)

### Other

- chore: Update validate-pr workflow by @​stephanie-anderson in
[#​5108](getsentry/sentry-dotnet#5108)
- ci: fix workflows that always fail for fork PRs by @​jamescrosswell in
[#​5065](getsentry/sentry-dotnet#5065)

Commits viewable in [compare
view](getsentry/sentry-dotnet@6.3.0...6.3.1).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Sentry.AspNetCore&package-manager=nuget&previous-version=6.3.0&new-version=6.3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
evgenygunko pushed a commit to evgenygunko/CopyWordsDA that referenced this pull request Apr 9, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [Sentry.Maui](https://sentry.io/) ([source](https://github.com/getsentry/sentry-dotnet)) | nuget | patch | `6.3.0` -> `6.3.1` |

---

### Release Notes

<details>
<summary>getsentry/sentry-dotnet (Sentry.Maui)</summary>

### [`v6.3.1`](https://github.com/getsentry/sentry-dotnet/blob/HEAD/CHANGELOG.md#631)

[Compare Source](getsentry/sentry-dotnet@6.3.0...6.3.1)

##### Fixes 🐛

-   fix: Workaround FileNotFoundException on Android when recovering sessions by [@&#8203;jamescrosswell](https://github.com/jamescrosswell) in [#&#8203;5084](getsentry/sentry-dotnet#5084)
-   fix: `CaptureFeedback` now supports multiple attachments correctly by [@&#8203;bitsandfoxes](https://github.com/bitsandfoxes) in [#&#8203;5077](getsentry/sentry-dotnet#5077)

##### Dependencies ⬆️

##### Deps

-   chore(deps): update Native SDK to v0.13.5 by [@&#8203;github-actions](https://github.com/github-actions) in [#&#8203;5119](getsentry/sentry-dotnet#5119)
-   chore(deps): update CLI to v3.3.5 by [@&#8203;github-actions](https://github.com/github-actions) in [#&#8203;5093](getsentry/sentry-dotnet#5093)
-   chore(deps): update Native SDK to v0.13.4 by [@&#8203;github-actions](https://github.com/github-actions) in [#&#8203;5081](getsentry/sentry-dotnet#5081)
-   chore(deps): update Java SDK to v8.37.1 by [@&#8203;github-actions](https://github.com/github-actions) in [#&#8203;5071](getsentry/sentry-dotnet#5071)
-   chore(deps): update CLI to v3.3.4 by [@&#8203;github-actions](https://github.com/github-actions) in [#&#8203;5068](getsentry/sentry-dotnet#5068)
-   chore(deps): update Java SDK to v8.37.0 by [@&#8203;github-actions](https://github.com/github-actions) in [#&#8203;5069](getsentry/sentry-dotnet#5069)
-   chore(deps): update Cocoa SDK to v9.8.0 by [@&#8203;github-actions](https://github.com/github-actions) in [#&#8203;5044](getsentry/sentry-dotnet#5044)
-   chore(deps): update Java SDK to v8.36.0 by [@&#8203;github-actions](https://github.com/github-actions) in [#&#8203;5036](getsentry/sentry-dotnet#5036)
-   chore(deps): update epitaph to 0.1.1 by [@&#8203;github-actions](https://github.com/github-actions) in [#&#8203;5036](getsentry/sentry-dotnet#5036)

##### Other

-   chore: Update validate-pr workflow by [@&#8203;stephanie-anderson](https://github.com/stephanie-anderson) in [#&#8203;5108](getsentry/sentry-dotnet#5108)
-   ci: fix workflows that always fail for fork PRs by [@&#8203;jamescrosswell](https://github.com/jamescrosswell) in [#&#8203;5065](getsentry/sentry-dotnet#5065)

</details>

---

### Configuration

📅 **Schedule**: Branch...
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

2 participants