Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
fix date
Browse files Browse the repository at this point in the history
  • Loading branch information
Bao Zhiyuan committed Oct 23, 2024
1 parent 5b41e69 commit 33a145b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ fs.mkdirSync('dist')

async function getPRInfo(teamName: string) {
const prNumber = getPrNumber(teamName)
console.log(teamName, prNumber)
const res = await ghClient.request(
'GET /repos/{owner}/{repo}/pulls/{pull_number}',
{
Expand Down Expand Up @@ -79,8 +80,9 @@ function getPrNumber(teamName: string): number {
const commit = $`git log --format=%H teams/${teamName}/${latestFile}`.split(
'\n',
)[0]
const oldestMergeCommit =
$`git rev-list --reverse --merges ${commit}^..HEAD`.split('\n')[0]
const oldestMergeCommit = $`git rev-list --merges ${commit}^..HEAD`.split(
'\n',
)[0]
const mergeCommitMessage = $`git log --format=%B -n 1 ${oldestMergeCommit}`
const title = mergeCommitMessage.split('\n')[0]
const prNumber = title.match(/Merge pull request #(\d+)/)?.[1]
Expand Down

0 comments on commit 33a145b

Please sign in to comment.