fix: inaccessible pull_request number in workflow_run#45
fix: inaccessible pull_request number in workflow_run#45typeslint-cli[bot] merged 3 commits intoTypeslint:developmentfrom
Conversation
|
Hello @Muunatic Thank you for submitting Pull Request, please wait for next notification after we review your Pull Request |
|
this fix is temporary and has not been tested to confirm its completely resolves the issue. |
|
It seems the issue stems from the API indicating an empty pull request array https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28. Even though this isn't from codebase issue itself but rather than from the GitHub API. |
indeed, checks_run are returning empty pull_request array data if pr comes from a forked repo. that is why i need to get pr author pulls list from the head_branch to get the exact pull_request data. for now it only works on the public repository and i need to test if the payload can still get pull_request data if pr comes from a private forked repo. |
|
i'm going to skip the review for now. i'll convert this prs to draft to double-check everything is good. |
|
I noticed the code might be pulling the wrong pull request if there are multiple open PRs. When you're fetching the PR number using res.data[0].number, it might not always grab the right one if there are multiple open PRs. If the workflow gets triggered on A possible fix could be filtering the data by res.data.find((a) => a.head.sha === this.context.payload.workflow_run.head_sha)?.number as number; |
sounds good. |
|
Hey there! Just checking in on your pull request – any updates on this? Is it good to merge or are the tests still in progress? |
ready for review @HarunamiYaki |
There was a problem hiding this comment.
@Muunatic your pull request has been approved by [MAINTAINER]@HarunamiYaki, please type Ready to merge for merging
|
ready to merge |
|
Merged by Muunatic! |
automaton encountered an error where the pull_request[0].number wasn't accessible within the workflow_run. pull_request would return an empty array when pull requests are made from forked repositories (outside main repository).