Skip to content

Commit 9147c98

Browse files
authored
Merge pull request #134 from multiformats/master-upgrade
upgrade@20043009302
2 parents f83404b + 120168f commit 9147c98

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/src/actions/find-sha-for-plan.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,29 @@ async function findShaForPlan(): Promise<string> {
66
const github = await GitHub.getGitHub()
77

88
if (context.eventName !== 'push') {
9+
console.log(
10+
`This is not a push event ("${context.eventName}"); returning "${context.sha}"`
11+
)
912
return context.sha
1013
}
1114

15+
const q = `repo:${context.repo.owner}/${context.repo.repo} ${context.sha} type:pr is:merged`
16+
console.log(`Running advanced query: ${q}`)
1217
const pulls = await github.client.paginate(
1318
github.client.search.issuesAndPullRequests,
1419
{
15-
q: `repository:${context.repo.owner}/${context.repo.repo} ${context.sha} type:pr is:merged`,
20+
q,
1621
advanced_search: 'true'
1722
}
1823
)
1924

2025
if (pulls.length === 0) {
26+
console.log('Got 0 pull request, returning empty string')
2127
return ''
2228
}
2329

2430
const pull = pulls[0]
31+
console.log(`Processing pull request number ${pull.number}`)
2532
const commits = await github.client.paginate(
2633
github.client.pulls.listCommits,
2734
{
@@ -31,9 +38,12 @@ async function findShaForPlan(): Promise<string> {
3138
)
3239

3340
if (commits.length === 0) {
41+
console.log('Found 0 commits, returning empty string')
3442
return ''
3543
}
3644

45+
const commit = commits[commits.length - 1]
46+
console.log(`Returning commit ${commit.sha}`)
3747
return commits[commits.length - 1].sha
3848
}
3949

0 commit comments

Comments
 (0)