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: v2
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: v3
Choose a head ref
Loading
Showing with 8,261 additions and 9,100 deletions.
  1. +1 −0 .dockerignore
  2. +10 −0 .eslintignore
  3. +2 −1 .github/tasks/actionYamlUpdater.js
  4. +5 −5 .github/workflows/ci.yml
  5. +4 −4 .github/workflows/commitlint.yml
  6. +1 −0 .husky/.gitignore
  7. +3 −0 .husky/commit-msg
  8. +3 −0 .husky/pre-commit
  9. +1 −1 .lintstagedrc.js
  10. +48 −0 CHANGELOG.md
  11. +1 −1 Dockerfile
  12. +7 −3 README.md
  13. +1 −1 action.yml
  14. +4 −0 fixtures/lerna-scopes/package.json
  15. +8,081 −9,000 package-lock.json
  16. +17 −22 package.json
  17. +4 −1 src/action.js
  18. +64 −59 src/action.test.js
  19. +4 −2 src/testUtils.js
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -7,4 +7,5 @@ coverage
fixtures
src/action.test.js
src/testUtils.js
.eslintignore
.eslintrc.json
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.git/
.vscode
/build/
/dist/
/coverage/
/LICENSE.md
/modules/
/node_modules/
/worktrees/
!.*
3 changes: 2 additions & 1 deletion .github/tasks/actionYamlUpdater.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const yaml = require('yaml')

yaml.scalarOptions.str.fold.lineWidth = 100

const versionRegex = /\d+\.\d+\.\d+/

module.exports.readVersion = contents =>
module.exports.readVersion = (contents) =>
yaml.parse(contents).runs.image.match(versionRegex)[0]

module.exports.writeVersion = (contents, version) => {
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2.1.4
- uses: actions/setup-node@v2.1.5
with:
node-version: '12.x'
- uses: actions/cache@v2.1.4
@@ -18,7 +18,7 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm ci --ignore-scripts
- run: npm run lint
- run: npm test -- --ci --coverage
release:
@@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2.1.4
- uses: actions/setup-node@v2.1.5
with:
node-version: '12.x'
- uses: actions/cache@v2.1.4
@@ -42,7 +42,7 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm ci --ignore-scripts
- name: Configure git user
run: |
git config user.email 'github-action@users.noreply.github.com'
@@ -64,7 +64,7 @@ jobs:
- name: Push to docker registry
run: |
docker push $DOCKER_REGISTRY_URL/wagoid/commitlint-github-action:$VERSION
- run: git push --follow-tags origin master
- run: git push --atomic --follow-tags origin master
- name: Create a git tag for the major version
run: |
major=`echo $VERSION | sed -E 's/([0-9]+)(.+)/\1/'`
8 changes: 4 additions & 4 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ jobs:
fetch-depth: 0
- run: sed -i -E "s/(docker:.+)/Dockerfile/" ./action.yml
- run: echo -n '' > .dockerignore
- uses: actions/setup-node@v2.1.4
- uses: actions/setup-node@v2.1.5
with:
node-version: '14'
- uses: actions/cache@v2.1.4
@@ -21,7 +21,7 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm ci --ignore-scripts
- uses: ./
id: run_commitlint
env:
@@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2.1.4
- uses: actions/setup-node@v2.1.5
with:
node-version: '14'
- uses: actions/cache@v2.1.4
@@ -46,7 +46,7 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm ci --ignore-scripts
- uses: ./
env:
NODE_PATH: ${{ github.workspace }}/node_modules
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
3 changes: 3 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

npx --no-install commitlint --edit "${1}"
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

npx --no-install lint-staged
2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
'*.{ts,tsx,vue,css,less,scss,html,htm,md,markdown}': 'prettier --write',
'*.{json,yml,yaml}': ['prettier --write', () => 'npm run test'],
'*.{js,jsx}': ['eslint --fix', () => 'npm run test']],
'*.{js,jsx}': ['eslint --fix', () => 'npm run test'],
}
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,54 @@

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

### [3.1.4](https://github.com/wagoid/commitlint-github-action/compare/v3.1.3...v3.1.4) (2021-05-19)

### [3.1.3](https://github.com/wagoid/commitlint-github-action/compare/v3.1.2...v3.1.3) (2021-05-10)

### [3.1.2](https://github.com/wagoid/commitlint-github-action/compare/v3.1.1...v3.1.2) (2021-05-08)

### [3.1.1](https://github.com/wagoid/commitlint-github-action/compare/v3.1.0...v3.1.1) (2021-05-04)

## [3.1.0](https://github.com/wagoid/commitlint-github-action/compare/v3.0.8...v3.1.0) (2021-04-06)


### Features

* add support for pull_request_target event ([de51303](https://github.com/wagoid/commitlint-github-action/commit/de513030467551ee03fb8827bd790967fd5818ab))

### [3.0.8](https://github.com/wagoid/commitlint-github-action/compare/v3.0.7...v3.0.8) (2021-04-05)

### [3.0.7](https://github.com/wagoid/commitlint-github-action/compare/v3.0.6...v3.0.7) (2021-04-01)

### [3.0.6](https://github.com/wagoid/commitlint-github-action/compare/v3.0.5...v3.0.6) (2021-03-02)


### Bug Fixes

* perform an atomic push when releasing ([9d00d1e](https://github.com/wagoid/commitlint-github-action/commit/9d00d1e75718143215dbf95c9c12956c56225e90))

### [3.0.5](https://github.com/wagoid/commitlint-github-action/compare/v3.0.3...v3.0.5) (2021-03-02)

### [3.0.4](https://github.com/wagoid/commitlint-github-action/compare/v3.0.3...v3.0.4) (2021-03-02)

### [3.0.3](https://github.com/wagoid/commitlint-github-action/compare/v3.0.2...v3.0.3) (2021-03-02)

### [3.0.2](https://github.com/wagoid/commitlint-github-action/compare/v3.0.1...v3.0.2) (2021-03-02)

### [3.0.1](https://github.com/wagoid/commitlint-github-action/compare/v3.0.0...v3.0.1) (2021-02-25)

## [3.0.0](https://github.com/wagoid/commitlint-github-action/compare/v2.2.5...v3.0.0) (2021-02-24)


### ⚠ BREAKING CHANGES

* **deps:** Remove support for lerna v2 and change the order of the `extends` resolution
from right-to-left to left-to-right.

### Bug Fixes

* **deps:** udpate commitlint monorepo to v12 ([8b0b095](https://github.com/wagoid/commitlint-github-action/commit/8b0b095f5e2c4a8bc5ebc94da6e1a9c0ebc6b862)), closes [#97](https://github.com/wagoid/commitlint-github-action/issues/97)

### [2.2.5](https://github.com/wagoid/commitlint-github-action/compare/v2.2.4...v2.2.5) (2021-02-18)

### [2.2.4](https://github.com/wagoid/commitlint-github-action/compare/v2.2.3...v2.2.4) (2021-02-17)
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ RUN apk --no-cache add git

COPY package*.json /

RUN npm ci --production
RUN npm ci --production --ignore-scripts

COPY . .

10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Commitlint Github Action

Lints Pull Request commits with commitlint
Lints Pull Request commits with [commitlint](https://commitlint.js.org/).

## Usage

@@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2
- uses: wagoid/commitlint-github-action@v3
```
Alternatively, you can run on other event types such as `on: [push]`. In that case the action will lint the push event's commit(s) instead of linting commits from a pull request. You can also combine `push` and `pull_request` together in the same workflow.
@@ -26,6 +26,8 @@ Alternatively, you can run on other event types such as `on: [push]`. In that ca

## Inputs

You can supply these inputs to the `wagoid/commitlint-github-action@v3` step.

### `configFile`

The path to your commitlint config file.
@@ -34,6 +36,8 @@ Default: `commitlint.config.js`

If the config file doesn't exist, [config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) settings will be loaded as a default fallback.

Details on the configuration file can be found on [the commitlint website](https://commitlint.js.org/#/reference-configuration).

### `firstParent`

When set to true, we follow only the first parent commit when seeing a merge commit.
@@ -138,7 +142,7 @@ jobs:
- run: npm install
# Run the commitlint action, considering its own dependencies and yours as well 🚀
# `github.workspace` is the path to your repository.
- uses: wagoid/commitlint-github-action@v2
- uses: wagoid/commitlint-github-action@v3
env:
NODE_PATH: ${{ github.workspace }}/node_modules
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ outputs:
description: The error and warning messages for each one of the analyzed commits
runs:
using: docker
image: docker://wagoid/commitlint-github-action:2.2.5
image: docker://wagoid/commitlint-github-action:3.1.4
branding:
icon: check-square
color: blue
4 changes: 4 additions & 0 deletions fixtures/lerna-scopes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "scoped",
"version": "0.1.0"
}
Loading