Skip to content

Update targets and permissions - #56513

Open
BillWagner wants to merge 2 commits into
dotnet:mainfrom
BillWagner:actions-review
Open

BillWagner wants to merge 2 commits into
dotnet:mainfrom
BillWagner:actions-review

Conversation

@BillWagner

Copy link
Copy Markdown
Member

Update the targets and permissions for github workflows

  • Use pull-request instead of pull-request-target
  • Apply necessary job permissions for checks and statuses (and occasionally pull-requests)

Update the targets and permissions for github workflows
Copilot AI balanced review requested due to automatic review settings October 21, 2026 17:49
@BillWagner
BillWagner requested a review from a team as a code owner October 21, 2026 17:49
@dotnetrepoman dotnetrepoman Bot added this to the October 2026 milestone Oct 21, 2026

Copilot AI 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.

🟢 Approval recommended

The status checker supports the new trigger, and no blocking issues were identified in the permission changes.

No open issues 🎉

What changed in this PR

Updates GitHub Actions triggers and job permissions for documentation build checks and reporting.

Changes:

  • Switches the OPS status checker from pull_request_target to pull_request.
  • Adds check-write access and expands status permissions for relevant jobs.
File Description
.github/​workflows/​snippets5000.yml Adds checks: write.
.github/​workflows/​ops-build-reporter.yml Changes status access from read to write.
.github/​workflows/​check-for-build-warnings.yml Changes the PR trigger and grants check/status write access.

Review effort: Balanced

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is okay? Not sure why you're adding add'l perms here since it's already working.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch. I thought I'd removed that.

runs-on: windows-2022
permissions:
statuses: write
checks: write

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why is this needed if it's working as-is?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is because when it moves from pull-request-target to pull-request, it needs this permission to write a check run result. This enables the snippets 5000 to write checks (as markdownlint does) when the PR is from a fork.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's already using pull_request though...

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.

3 participants