Repository navigation
Specify default permissions for pull-request-trigger.yml and wr-pull-request-trigger.yml #8590
Description
Activity
- addedrole: back end/devOpsTasks for back-end developersTasks for back-end developersFeature: Refactor GHARefactoring GitHub actions to fit latest architectural normsRefactoring GitHub actions to fit latest architectural norms
on Mar 28, 2026 - addedsize: 8ptCan be done in 31-48 hoursCan be done in 31-48 hoursDraftIssue is still in the process of being createdIssue is still in the process of being created
on Mar 28, 2026 - moved this to New Issue Approval in P: HfLA Website: Project Board
on Mar 28, 2026 - changed the title
[-]Specify default permissions for `pull-request-trigger.yml`[/-][+]Specify default permissions for `pull-request-trigger.yml` and `wr-pull-request-trigger.yml`[/+]on Mar 28, 2026 - added and removedDraftIssue is still in the process of being createdIssue is still in the process of being created
on Mar 30, 2026 - moved this from New Issue Approval to Ready for Prioritization in P: HfLA Website: Project Board
on Mar 30, 2026 17 remaining items
- addedstatus: To Update!No update has been providedNo update has been provided
on Sep 11, 2026 hfla-graphql-app commented
on Sep 11, 2026 on Sep 11, 2026 · Hidden as outdatedshow commentMore actions- Unfortunately haven't had the time to start this issue just yet
- Only blocker is time
- I'm available 9/12 9am-2pm, 9/14 after 6pm, 9/15 after 3pm
- I may need a couple more days to complete this issue, new ETA should be 9/16 (Edit: New ETA is 9/22. I'd like to complete it before next Tuesday and as I need to take the time to understand the issue & get feedback on a proposed implementation)
- addedstatus: UpdatedNo blockers and update is ready for reviewNo blockers and update is ready for reviewand removedstatus: To Update!No update has been providedNo update has been provided
on Sep 11, 2026 Hi @daras-cu, I had an idea to implement a fix which I'll work on in the coming days! In the meantime I'd like some feedback on my thought process to make sure I understand the issue and what it's asking:
Following Will's proposed implementation to troubleshoot the 403 error and his note below:
The more difficult part is that the functionality to post a comment needs to move from pull-request-trigger.yml to wr-pull-request-trigger.yml, and the first workflow probably needs to pass the second an artifact similar to set-pr-labels.yaml and wr-set-pr-labels.yaml.
I was thinking about splitting up the logic in check-linked-issue.js (the script used by
pull-request-trigger.yml) between checking if issues are linked and the ability to post PR comments. Rather than making separate modules, this refactor could split them from one main() call into helper functions. Similar to how set-pr-labels.js has a split. This would also be useful for implementing artifacts.Would this be a solid implentation to start with?
I myself don't have too much experience working with GHA artifacts so I'm linking a few below for my reference as I work on this issue. If there are any resources or ideas you'd like to add please share them!
@castillios I think you're on the right track, we will need to split up the main function in
check-linked-issue.jsbut I believe both functions can stay in the same file like inset-pr-labels.js, then each workflow can call the relevant function. It does seem like an artifact is the way to pass the desired comment from one workflow to another. I haven't worked with them either but I found one other resource in GitHub's documentation that matches what we'll be doing pretty closely: Using data from a triggering workflow.Let me know how it goes once you start working, as always we may have to change tactics but in theory what you're thinking of should work!
Reacted by Maleah Smith- addedstatus: To Update!No update has been providedNo update has been providedand removedstatus: UpdatedNo blockers and update is ready for reviewNo blockers and update is ready for review
on Sep 25, 2026 hfla-graphql-app commented
on Sep 25, 2026 on Sep 25, 2026 · Hidden as resolvedshow commentMore actions- Progress: I have the idea in mind, I just need to go ahead and implement then test.
- Blockers: Time. I have unfortunately been busier than expected this past week.
- Availability: 9/27 after 8PM, 9/28 after 7PM, 9/30 all day
- ETA: By 9/29 I should have a PR up
- addedstatus: UpdatedNo blockers and update is ready for reviewNo blockers and update is ready for reviewand removedstatus: To Update!No update has been providedNo update has been provided
on Sep 27, 2026 - removedstatus: UpdatedNo blockers and update is ready for reviewNo blockers and update is ready for review
on Oct 1, 2026
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn progress (actively working)
Prerequisites
Overview
We need to update the default permissions for the GitHub workflow specified in pull-request-trigger.yml and wr-pull-request-trigger.yml, so that it does not have more permissions than it needs.
Details
To align with GitHub security best practices, we want to specify the minimum required permissions for each workflow via a top-level
permissions:block to ensure that workflows only have the access they need by default.Every GitHub Actions workflow automatically receives a
GITHUB_TOKENwith a set of default repository permissions defined in the repo settings which may result in the workflow having more permissions than it needs to complete its job. By explicitly defining minimum default permissions at the workflow level, we can ensure that workflow has only the permissions it needs. Then if a job or step requires more access, those permissions can be explicitly granted using job-level permissions statements or step-level tokens (PATs).We performed an audit to identify the minimum top-level permissions required for each workflow. The goal of this and related issues is to verify that each workflow continues to function correctly with the explicitly defined permissions. This approach helps minimize unnecessary privileges and strengthen overall repository security.
For additional info, see issue #8178 and GitHub's recommendation for security best practice.
Action Items
Note that this issue involves testing GitHub Actions. See "Resources/Instructions" below for how to set up your personal environment for testing.
Refer to pull-request-trigger.yml.
on:section.jobs:insert:Next, refer to wr-pull-request-trigger.yml.
on:section.jobs:insert:Resources/Instructions