forked from line/armeria
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Fix to correctly leave Gradle build scan results as a comment (…
…line#5126)" This reverts commit 1ce4c69.
- Loading branch information
Showing
6 changed files
with
113 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2023 LINE Corporation | ||
* | ||
* LINE Corporation licenses this file to you under the Apache License, | ||
* version 2.0 (the "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at: | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { Octokit } from 'octokit'; | ||
import * as core from '@actions/core'; | ||
|
||
main(); | ||
|
||
async function main(): Promise<void> { | ||
const octokit = new Octokit({auth: process.env.GITHUB_TOKEN}); | ||
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); | ||
|
||
const sha = process.env.COMMIT_SHA; | ||
console.log(`💻 Getting pull request number for ${sha} ...`) | ||
const {data: {check_suites}} = await octokit.rest.checks.listSuitesForRef({ | ||
owner: owner, | ||
repo: repo, | ||
ref: sha, | ||
}); | ||
|
||
let prNumber = 0; | ||
for (const item of check_suites) { | ||
if (item.pull_requests.length > 0) { | ||
prNumber = item.pull_requests[0].number; | ||
break; | ||
} | ||
} | ||
if (prNumber === 0) { | ||
// The build is not triggered by a pull request. | ||
console.log("❔ No pull request found."); | ||
return; | ||
} else { | ||
console.log(`✅ Pull request number: ${prNumber}`); | ||
core.setOutput("pr_number", prNumber); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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