Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bc25072

Browse filesBrowse files
authored
Merge pull request #800 from wagoid/revert-798-feat/using-rest-for-push
Revert "feat: updating push event trigger to use rest API (OctoKit) vs push event"
2 parents dbd4ecd + 09a8abb commit bc25072
Copy full SHA for bc25072

File tree

Expand file treeCollapse file tree

3 files changed

+124
-260
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+124
-260
lines changed

‎src/action.mjs

Copy file name to clipboardExpand all lines: src/action.mjs
+6-14Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,13 @@ const getCommitDepth = () => {
2222
return Number.isNaN(commitDepth) ? null : Math.max(commitDepth, 0)
2323
}
2424

25-
const getPushEventCommits = async () => {
26-
const octokit = getOctokit(getInput('token'))
27-
const { owner, repo } = eventContext.issue
28-
const { before } = eventContext.payload
29-
const { data: commits } = await octokit.rest.repos.listCommits({
30-
owner,
31-
repo,
32-
sha: before,
33-
per_page: 100,
34-
})
35-
36-
return commits.map((commit) => ({
37-
message: commit.commit.message,
38-
hash: commit.sha,
25+
const getPushEventCommits = () => {
26+
const mappedCommits = eventContext.payload.commits.map((commit) => ({
27+
message: commit.message,
28+
hash: commit.id,
3929
}))
30+
31+
return mappedCommits
4032
}
4133

4234
const getPullRequestEventCommits = async () => {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.