question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document use of commitlint as a github action (possible own CLI in the future)

See original GitHub issue

Expected Behavior

Provide a github actions cli just like commitlint-travis.

Context

It should easy setup for running commitlint as part of a github actions setup.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:45
  • Comments:29 (6 by maintainers)

github_iconTop GitHub Comments

17reactions
arznaarcommented, Jul 12, 2020

I think you can also just call @commitlint/cli for this and get number of commits from PR event commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD and fetch all commits in checkout fetch-depth: 0. Here is full example:

on: [pull_request]
jobs:
  lint-commits:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.1
        with:
          # we actually need "github.event.pull_request.commits + 1" commit
          fetch-depth: 0
      - uses: actions/setup-node@v2.1.0
      # or just "yarn" if you depend on "@commitlint/cli" already
      - run: yarn add @commitlint/cli
      - run: yarn run commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
6reactions
wagoidcommented, Oct 8, 2019

I’ve created a github action for this that doesn’t require any setup, if you want to have a look: https://github.com/marketplace/actions/commit-linter

I tried using @bennypowers’s action but got some issues and ended up creating another one, as explained here

I am already using in some projects, feel free to use it too and let me know if anything goes wrong 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to lint the message of a pull request merge commit?
I've set up a GitHub Actions workflow that uses commitlint to lint messages ... "future" merge commit, but I didn't find a way...
Read more >
Commitlint: Write more organized code - LogRocket Blog
Make your life easier as a developer by using commitlint to format, standardize, and organize code and messages.
Read more >
@ngneat/lib - npm
Automated releases with GitHub Actions; Secrets and tokens; Initial release; Working on a future release. Deployment.
Read more >
Git Hooks | Atlassian Git Tutorial
Git Hooks are scripts that run automatically every time a particular event occurs in a Git repository. Learn what they do and how...
Read more >
JS monorepos in prod 3: commit enforcement and changelog ...
Since Commitizen has already modified our package.json file, we can just stage that file and use the npx cz command instead of git...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found