How lint every single commit in a PR?
See original GitHub issueHow can I lint every single commit in a PR?
name: On Push
on: [push]
jobs:
lint-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v1
with:
configFile: './.commitlintrc.yml'
firstParent: false
failOnWarnings: true
commitlintrc.yml
:
---
extends:
- '@commitlint/config-conventional'
Run wagoid/commitlint-github-action@v15s
Run wagoid/commitlint-github-action@v1
/usr/bin/docker run --name wagoidcommitlintgithubaction160_8073c3 --label c27d31 --workdir /github/workspace --rm -e INPUT_CONFIGFILE -e INPUT_FIRSTPARENT -e INPUT_FAILONWARNINGS -e INPUT_HELPURL -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_API_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/MessingUp/MessingUp":"/github/workspace" wagoid/commitlint-github-action:1.6.0
##[error]You have commit messages with errors
⧗ input: style:
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
The configuration above only checks the last commit in the PR, see this example =|
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Squashing Your Pull Requests - Cloud Four
Squash is a Git option to collapse all the incremental commits in your pull request into a single commit. If you use the...
Read more >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 for all commits of a pull request, but the problem...
Read more >Commit Message Lint — Improve the Code Commit Quality
Commit Message format check One PR can have multiple commits and all the commit messages are checked. Similar to PR title, commit messages...
Read more >How to merge only specific commits from a pull request with ...
Go to either the git log or the GitHub UI and grab the unique commit hashes for each of the commits that you...
Read more >Clean up your commits for a pull request - Christoph Rumpel
The first one is our new feature. The second is adding a test and the last one is fixing a typo. The last...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kerry-perret yep, the scenario of linting locally can also be covered! You can see how it’s done here in Commitlint’s getting started, basically the idea is to use
husky
to run commitlint on each commit. For that you’ll also need to install some dependencies in the repo, like husky and commitlint ones, like explained in the getting started 😃Regarding the error you got when force pushing, did you force push 2 times in a row? When force pushing multiple times quickly we can get into a state that github gives us a SHA1 that points to a commit that doesn’t exist anymore. It ends up being some kind of limitation that we can’t cover in those cases due to how GitHub Actions work.
BTW issue reopened ✔️
Hi @kerry-perret, is there anything else I can help on this issue?