Fix to correctly leave Gradle build scan results as a comment #5126
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.
Motivation:
A pull request number fails to get retrieved from a commit SHA of a PR. Interestingly, it was not a problem while testing the feature in the personal repo. Because that happens only when the commit is made from a forked repository.
For example, the PR information of 529961c is retrieved by https://api.github.com/repos/minwoox/armeria/commits/529961c4a43fb884cf780421218de4f56f1aafcc/pulls but https://api.github.com/repos/line/armeria/commits/529961c4a43fb884cf780421218de4f56f1aafcc/pulls returns an empty array. Note that the owners of the repository are different.
As a result, the scan results are not updated as a comment of a PR.
armeria/.github/workflows/gradle-build-scan.yml
Line 90 in 0cd7094
Modifications:
get-pr-number-by-sha.ts
and its dependenciesResult:
Correctly update build scan results.