[TTAHUB-5460] Update quality_check workflows to use correct permissions#3708
Merged
thewatermethod merged 2 commits intoJun 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Actions “PR Quality Checks” workflow trigger to avoid failures on fork-based PRs caused by the restricted GITHUB_TOKEN permissions when using pull_request.
Changes:
- Switch workflow trigger from
pull_requesttopull_request_targetso the workflow runs in the base-branch context (restoring the ability to create/update PR comments). - Update the
diff_size_checkjob guard to match the new event name.
Impact assessment: Benefits medium (restores workflow functionality for forks); Risks low (workflow uses actions/github-script only and does not check out or execute PR code).
AdamAdHocTeam
approved these changes
Jun 18, 2026
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
Fix
PR Quality Checksworkflow failures caused bypull_requestevents from forked repositories running with a restrictedGITHUB_TOKEN.GitHub intentionally limits the
GITHUB_TOKENto read-only forpull_requestevents originating from forks, regardless of thepermissions:block declared in the workflow. This caused both the diff size advisory and review count advisory steps to fail with:Fix: Replace
pull_requestwithpull_request_targetas the workflow trigger.pull_request_targetfires in the context of the base branch, giving the token the write permissions it needs to create and update PR comments.This is safe because the workflow never checks out or executes any code from the PR — it only reads PR metadata via the GitHub API and posts informational comments.
The
if:condition ondiff_size_checkwas also updated fromgithub.event_name == 'pull_request'togithub.event_name == 'pull_request_target'to match.How to test
mainmaindiff_size_checkandreview_count_checkjobs run and post comments successfully — including from fork PRsJira Issue(s)
Checklists
Every PR