mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2025-11-07 00:06:54 +00:00
feat: updating push event trigger to use rest API (OctoKit) vs push event
This commit is contained in:
parent
baa1b236f9
commit
70e22e9538
1 changed files with 13 additions and 6 deletions
|
|
@ -22,13 +22,20 @@ const getCommitDepth = () => {
|
|||
return Number.isNaN(commitDepth) ? null : Math.max(commitDepth, 0)
|
||||
}
|
||||
|
||||
const getPushEventCommits = () => {
|
||||
const mappedCommits = eventContext.payload.commits.map((commit) => ({
|
||||
message: commit.message,
|
||||
hash: commit.id,
|
||||
}))
|
||||
const getPushEventCommits = async () => {
|
||||
const octokit = getOctokit(getInput('token'))
|
||||
const { owner, repo, before } = eventContext.issue
|
||||
const { data: commits } = await octokit.rest.repos.listCommits({
|
||||
owner,
|
||||
repo,
|
||||
sha: before,
|
||||
per_page: 100,
|
||||
})
|
||||
|
||||
return mappedCommits
|
||||
return commits.map((commit) => ({
|
||||
message: commit.commit.message,
|
||||
hash: commit.sha,
|
||||
}))
|
||||
}
|
||||
|
||||
const getPullRequestEventCommits = async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue