Skip to content

Commit

Permalink
refactor: Get commit list.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jan 6, 2021
1 parent 3893910 commit 95cc441
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ async function run() {
await exec.exec('git fetch --depth=1 origin +refs/tags/*:refs/tags/*');
await exec.exec('git fetch --prune --unshallow');

const commitList = await octokit.repos.listBranchesForHeadCommit({
...github.context.repo,
commit_sha: baseRef
})
core.info(`Commit List: \x1b[34m${JSON.stringify(commitList.data)}\x1b[0m`)
// octokit.repos.listCommits({})
// octokit.repos.listCommentsForCommit

let tagRef = '';
if ((github.context.ref || '').startsWith('refs/tags/')) {
tagRef = getVersion(github.context.ref)
Expand Down
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ async function run() {
await exec.exec('git fetch --depth=1 origin +refs/tags/*:refs/tags/*');
await exec.exec('git fetch --prune --unshallow');

const commitList = await octokit.repos.listBranchesForHeadCommit({
...github.context.repo,
commit_sha: baseRef
})
core.info(`Commit List: \x1b[34m${JSON.stringify(commitList.data)}\x1b[0m`)
// octokit.repos.listCommits({})
// octokit.repos.listCommentsForCommit

let tagRef = '';
if ((github.context.ref || '').startsWith('refs/tags/')) {
tagRef = getVersion(github.context.ref)
Expand Down

0 comments on commit 95cc441

Please sign in to comment.