-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] broken commit message length test #6398
Conversation
9b8fb8f
to
5e668b4
Compare
I tried another approach (commit fdf3481). |
7e7a1e5
to
8e23b09
Compare
Okay, this should work. I've also made the check a separate job, because I don't think it's a good idea to stop most of the pipeline due to an overly long commit message. CI overall will still fail, but other tests will run also. P.S. side note, tested that this works here: https://github.com/jgm/pandoc/runs/706874492?check_suite_focus=true |
I like your version better than mine! Can you rebase it on master; I got my change in first and it conflicts. |
8e23b09
to
304f42e
Compare
Sure, rebased. |
To address the issue of multiple commits, would it work to do |
It'd work for PRs against the master branch probably. Not sure if that'd work for direct commits to the master branch, and it wouldn't work for PRs against non-master branches (which are rare, but not unthinkable). So, probably, not the best idea. That's not to say it wouldn't be possible, but implementation details elude me at the moment. |
Not entirely sure if it's doable in bash, but a combination of approaches used in I could probably slap together something workable closer to the end of this week (have stuff to do in the next couple days, so can't really start hacking straight away) |
Update, apparently, |
Here's what I figured out so far. On push, it's actually rather simple, we can use It's possible to do the same on pull request, but there's a catch: there's no Hence, this all becomes rather manageable -- the only trick is that we need to define the base for log conditionally based on I'll try to slap something together on my test repo, and will copy the result to this PR after some tests. |
Okay, after testing for a bit, I found that there is a slight problem with the Arguably, the point is moot anyway, because I guess we're primarily interested in checks on PRs, and not direct pushes (?). To this effect, I've actually opted to move the check into a separate workflow (so that we can control when it triggers independently of the rest of CI), and only enabled it on pull requests for now (without ignores mind). The code itself supports both P.S. Actually, for new branches it should be possible to P.P.S. I've spent way more time on this than was reasonable, but I believe I've got it, more or less. One caveat is that commits on push will only be marked as failing once, but I would argue that's preferable. |
Great! Yes, this is one of those things that gets out of hand, because it seems like it will be simple, but it isn't. |
So, okay, this isn't easy to fix, because GitHub creates a merge commit on pull requests. See CI output on the last commit.