Skip to content

Commit

Permalink
Revert "feat: updating push event trigger to use rest API (OctoKit) v…
Browse files Browse the repository at this point in the history
…s push event"
  • Loading branch information
wagoid authored Aug 21, 2024
1 parent dbd4ecd commit 09a8abb
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 260 deletions.
20 changes: 6 additions & 14 deletions src/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,13 @@ const getCommitDepth = () => {
return Number.isNaN(commitDepth) ? null : Math.max(commitDepth, 0)
}

const getPushEventCommits = async () => {
const octokit = getOctokit(getInput('token'))
const { owner, repo } = eventContext.issue
const { before } = eventContext.payload
const { data: commits } = await octokit.rest.repos.listCommits({
owner,
repo,
sha: before,
per_page: 100,
})

return commits.map((commit) => ({
message: commit.commit.message,
hash: commit.sha,
const getPushEventCommits = () => {
const mappedCommits = eventContext.payload.commits.map((commit) => ({
message: commit.message,
hash: commit.id,
}))

return mappedCommits
}

const getPullRequestEventCommits = async () => {
Expand Down
Loading

0 comments on commit 09a8abb

Please sign in to comment.