-
Notifications
You must be signed in to change notification settings - Fork 63
ci: add commit checks for PRs #734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add commit checks for PRs #734
Conversation
Could you add the missing newline in a non-signed off commit, possibly being result of something you merged into this PR branch, later rebase it? |
I'll add a dummy commit 👍 -- done. Should fail CI now (I hope) |
Oki could you now add a merge commit as well? |
mmm. What I did broke something here. It seems the commitlint check is walking the wrong commits now. So the wrong step fails. --- update --- Turns out
Since the code has changed I'll start the "tests" from the start again.
non-signed commit
with merge commit
non-conventional-commit (was also unsigned)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. I think the non-action usage of javascript is ok without auditing, even though the thing has a long lockfile..
Could you give docs/CONTRIBUTING.md
a once over for for example listing what checks are now done automatically and so on?
Otherwise this looks good to start the 24h merge period.
This should be safe as it requires data transfers in excess of 18 exabytes. This should be reverted with the tokio 1.0 upgrade. Signed-off-by: Mirko von Leipzig <mirko.vonleipzig@gmail.com>
This adds checks for: - conventional commit messages - used `git commit --signoff` - no extra merge commits in PR Signed-off-by: Mirko von Leipzig <mirko.vonleipzig@gmail.com>
Signed-off-by: Mirko von Leipzig <mirko.vonleipzig@gmail.com>
Thank you @Mirko-von-Leipzig very much! |
This PR introduces a new github workflow which ensures all commits in a PR conform to our requirements. It checks for the following:
git commit --signoff
Conventional commits and
--signoff
The first two points are taken care of by the NPM
commitlint
package. Unfortunately, they provide guides for CircleCI and TravisCI but not for Github Actions (open issue). I managed to get it working after some trial and error.There is a 3rd party Github Action which looks great, but unfortunately I ran into this bug. It also seemed like a lot of code to audit, considering we don't need much.
Another alternative could be to use
git interpret-trailers
to check for--signoff
, but since this came bundled withcommitlint
I didn't explore further.no extra merge commits
This gets checked with some simple bash code walking the PR commits using
git log --merges --ancestry-path
. Luckily the Github PR event contains theHEAD
and number of commits in the PR.Why a new workflow file?
It has different run
on
requirements and therefore requires its own file (I think?).It made sense to me that it should only run on actual PRs. It would otherwise trigger (and probably fail) when wanting to test things quickly.
I also enabled it for PRs into any branch (and not just into master), since its likely the code would eventually make its way into a PR for
master
, but by that time it may be too late to get the commit requirements fixed.cargo audit
I've also added in the ignore for the two hyper RUSTSECs.