Repository navigation
Update and refactor pr trigger permissions - #8815
Open
castillios wants to merge 11 commits into
Open
castillios wants to merge 11 commits into
castillios wants to merge 11 commits into
Conversation
- splits the logic in check-linked-issue.js between checking for a linked issue and posting a comment if it is needed - utilize artifacts to pass comment data into its corresponding workflow run - pr trigger purely handles checking for linked issues - wr-pull-request-trigger now handles comment logic
|
Want to review this pull request? Take a look at this documentation for a step by step guide! From your project repository, check out a new branch and test the changes. |
12 tasks done
Member
Author
|
Hi @daras-cu, while working on this solution, I modeled the refactor off of set-pr-labels.js and how it uses artifacts. Since the functions are very similar, should we consider creating an ER and making a shared module to handle artifacts? |
daras-cu
self-requested a review
October 1, 2026 21:01
Member
|
ETA: 10/5 EOD |
This branch has not been deployed
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.
Fixes #8590
What changes did you make?
Add default permissions
contents: readto pull-request-trigger.ymlRefactor workflow
pull-request-trigger.ymlinto the following:pull-request-trigger.ymlhandles linked issue checkingwr-pull-request-trigger.ymlhandles PR commentingcheck-linked-issue.jsinto 3 main functions (downloadPRCommentArtifact, checkForLinkedIssue, postPRComment) and several helper functionsClean up
console.logwithcore.infoWhy did you make the changes (we will use this info to test)?
Add default permissions
wr-pull-request-trigger.ymlto include an additional permission,pull-requests: writewr-pull-request-trigger.ymlBOTHissues: writeandpull-requests: writewere added to allow PR commenting. Despite github docs implying that only one write permission is needed, without both permissions a 403 error will still occur: Testing log with only one write permission. I've included successful test logs using both permissions at the bottom of this PR.Refactor workflow
check-linked-issue.jswas broken up into several functions to allow the functionality to split into two automations.Clean up
console.logwithcore.infofor consistency as they are typically used as a logging tool for GHA workflows.CodeQL Alerts
After the PR has been submitted and the resulting GitHub actions/checks have been completed, developers should check the PR for CodeQL alert annotations.
Check the PR's comments. If present on your PR, the CodeQL alert looks similar as shown
Please let us know that you have checked for CodeQL alerts. Please do not dismiss alerts.
Instructions for resolving CodeQL alerts
If CodeQL alert/annotations appear, refer to How to Resolve CodeQL alerts.
In general, CodeQL alerts should be resolved prior to PR reviews and merging
Screenshots of Proposed Changes To The Website (if any, please do not include screenshots of code changes)
No visual changes to the website
I tested the workflow for three different scenarios. In WR PR Trigger Log, please view "Post Comment to PR" for a detailed log:
I later added PR #'s to WR PR Trigger's logging - Test log:
