Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wagoid/commitlint-github-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.2
Choose a base ref
...
head repository: wagoid/commitlint-github-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.1.0
Choose a head ref
  • 4 commits
  • 7 files changed
  • 3 contributors

Commits on Aug 19, 2024

  1. Copy the full SHA
    70e22e9 View commit details

Commits on Aug 20, 2024

  1. fix: updating unit tests with mocking push octokit list commits

    Brian-Triplett committed Aug 20, 2024
    Copy the full SHA
    c3ab7fd View commit details
  2. Merge pull request #798 from ncino/feat/using-rest-for-push

    feat: updating push event trigger to use rest API (OctoKit) vs push event
    wagoid authored Aug 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    0de1544 View commit details
  3. chore(release): publish 6.1.0 [skip-ci]

    GitHub Action committed Aug 20, 2024
    Copy the full SHA
    dbd4ecd View commit details
Showing with 276 additions and 128 deletions.
  1. +12 −0 CHANGELOG.md
  2. +1 −1 action.yml
  3. +2 −2 package-lock.json
  4. +1 −1 package.json
  5. +14 −6 src/action.mjs
  6. +231 −113 src/action.test.mjs
  7. +15 −5 src/testUtils.mjs
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [6.1.0](https://github.com/wagoid/commitlint-github-action/compare/v6.0.2...v6.1.0) (2024-08-20)


### Features

* updating push event trigger to use rest API (OctoKit) vs push event ([70e22e9](https://github.com/wagoid/commitlint-github-action/commit/70e22e95384c0028a4a5a9679a729c3ac9224dcd))


### Bug Fixes

* updating unit tests with mocking push octokit list commits ([c3ab7fd](https://github.com/wagoid/commitlint-github-action/commit/c3ab7fd301c536b0e96211a1dde49b6aabbfa8fd))

## [6.0.2](https://github.com/wagoid/commitlint-github-action/compare/v6.0.1...v6.0.2) (2024-08-05)

## [6.0.1](https://github.com/wagoid/commitlint-github-action/compare/v6.0.0...v6.0.1) (2024-04-10)
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ outputs:
description: The error and warning messages for each one of the analyzed commits
runs:
using: docker
image: docker://wagoid/commitlint-github-action:6.0.2
image: docker://wagoid/commitlint-github-action:6.1.0
branding:
icon: check-square
color: blue
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commitlint-github-action",
"version": "6.0.2",
"version": "6.1.0",
"description": "commitlint github action",
"private": true,
"module": "./dist/run.mjs",
20 changes: 14 additions & 6 deletions src/action.mjs
Original file line number Diff line number Diff line change
@@ -22,13 +22,21 @@ 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 } = eventContext.issue
const { before } = eventContext.payload
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