-
Notifications
You must be signed in to change notification settings - Fork 60.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7,431 changed files
with
5,621,549 additions
and
13,656,336 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
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
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
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,44 @@ | ||
#!/usr/bin/env node | ||
import got from 'got' | ||
|
||
import { setOutput } from '@actions/core' | ||
|
||
import github from '../../script/helpers/github.js' | ||
import { getActionContext } from './lib/action-context.js' | ||
|
||
async function main() { | ||
const sha = await getBuiltSHA() | ||
console.log({ sha }) | ||
|
||
const actionContext = getActionContext() | ||
const { owner, repo } = actionContext | ||
|
||
const octokit = github() | ||
let number = '' | ||
|
||
const q = `${sha} repo:"${owner}/${repo}"` | ||
const { data } = await octokit.rest.search.issuesAndPullRequests({ q }) | ||
for (const issue of data.items) { | ||
// console.log(issue) | ||
console.log('ID:', issue.id) | ||
console.log('Number:', issue.number) | ||
console.log('URL:', issue.html_url) | ||
number = issue.number | ||
if (number) { | ||
break | ||
} | ||
} | ||
|
||
setOutput('number', number) | ||
} | ||
|
||
async function getBuiltSHA() { | ||
const r = await got('https://docs.github.com/_build') | ||
const sha = r.body.trim() | ||
if (!/[a-f0-9]{40}/.test(sha)) { | ||
throw new Error(`Response body does not look like a SHA ('${r.body.slice(0, 100)}'...)`) | ||
} | ||
return sha | ||
} | ||
|
||
main() |
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
Oops, something went wrong.