Skip to content

Commit

Permalink
Merge pull request #800 from wagoid/revert-798-feat/using-rest-for-push
Browse files Browse the repository at this point in the history
Revert "feat: updating push event trigger to use rest API (OctoKit) vs push event"
  • Loading branch information
wagoid authored Aug 21, 2024
2 parents dbd4ecd + 09a8abb commit bc25072
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 bc25072

Please sign in to comment.