-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Original commit message is checked after the Pull Request commit has been updated #95
Comments
Hi @gaohoward, this seems strange because I have been using this action for a long time with the exact steps you mentioned and is working fine. My guess is that you are not actually updating the last commit with the |
Hi @dtcMLOps , I'm pretty sure I used |
I'm also seeing this behaviour when testing this out.
If I close the PR and recreate it then it works as expected, but closing and recreating the PR is not desirable in my use case. |
Same problem here. Seems updated commit messages are not checked but the original one. Closing and reopening an PR does not work... Any ideas? Here is my workflow: Works after manual merge: https://github.com/fnagel/t3extblog/actions/runs/6869676303 |
@fnagel have you tried a different regex pattern? you can use this website https://regexr.com/ to make sure the regex pattern is working fine |
@dtcMLOps The pattern works fine. The actions checks an outdated commit message. See |
@fnagel the commits before and after are not the same. This is the commit before:
This is the commit after
In summary, you must be using the title of the pull request during merging as a commit message |
@dtcMLOps Thanks for your help!
I know, but I did not change the message when merging manually. Even the Github PR page showed the correct message (with the "[BUGFIX]..." prefix. See here: https://github.com/fnagel/t3extblog/pull/267/commits
Not sure what is meant with this. Can you please explain. |
@fnagel ohhh i see. You are right. I think the issue relates to how GitHub gets the HEAD when running the github actions. What I recommend you is to update the https://github.com/fnagel/t3extblog/blob/master/.github/workflows/commit-message.yml workflow to include the https://github.com/actions/checkout before running the gscommit message checker. In that way, you will receive all the commits in the pull request and then, the checker can read the commit messages in the correct way. I have this in my workflow In your case I think, depth = 0 is not necessary. |
This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
So, this should work as expected, right? ps:
|
Hi @fnagel , yes that should work. I have been using this action a lot time without any issue. |
This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
@dtcMLOps I've just amend and force pushed the PR with a valid new commit message, but the action still uses the initial commit message :-/ https://github.com/fnagel/t3extblog/actions/runs/6880677110/job/18715401752?pr=268 Maybe it will work only after merge? Even though the changed workflow file seems already be used. |
@fnagel try marking these parameters as true: excludeTitle: true
excludeDescription: true
checkAllCommitMessages: true and provide the accesstoken: accessToken: ${{ secrets.GTHUB_TOKEN }} |
This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. This line is toooooo long, I mean, really tooooooo long, way toooooooo long, not sure what to do! GsActions/commit-message-checker#95
This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. This line is toooooo long, I mean, really tooooooo long, way toooooooo long, not sure what to do! GsActions/commit-message-checker#95
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
…ooo long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
@dtcMLOps It seems to work with excludeTitle and excludeDescription only! Thanks a lot! I did some tests, it works even though there are always two check (push and pull_request). See here: fnagel/t3extblog#268 Sadly, it seems my line length check does no longer work: https://github.com/fnagel/t3extblog/actions/runs/6882862878/job/18722248177?pr=268#step:5:1 |
Hi @fnagel I remember that the max lenght regex pattern has some errors in the provided example. Maybe you can try a different one. This is my regex pattern for max length # validate message length to 70 characters max.
- name: Check Subject Max Line Length
uses: [email protected]
with:
pattern: "^.{0,70}(\n.*)*$"
error: "The maximum line length of 70 characters is exceeded."
excludeTitle: "true" # optional: this excludes the title of a pull request
excludeDescription: "true" # optional: this excludes the description body of a pull request
checkAllCommitMessages: "true" # optional: this checks all commits associated with a pull request
accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true |
enable the checkAllCommits to true and provide the access token. |
I've just noticed that sometimes my length check works (but this is the old branch, without the latest workflow changes): https://github.com/fnagel/t3extblog/actions/runs/6883815705/job/18725113078 I need to test this a little more. Tomorrow :-) Thanks a lot for your help! |
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
@dtcMLOps Sorry for the late response. My workforce was needed elsewhere :-/ I've tried using your regex, but that didn't help, see: Adding checkAllCommits seems to help with the "No commits found in the payload, skipping check." problem (see https://github.com/fnagel/t3extblog/actions/runs/6981782801/job/18999633723) but it still does not work for the length check. Any ideas? |
Hi @fnagel i think here should be ^.{0,72}(\n.*)*$ instead |
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
Hi @dtcMLOps, sadly, that did not help: https://github.com/fnagel/t3extblog/actions/runs/6982176614/job/19000809120 |
Hi @fnagel this could be silly, but can you change the regex pattern to use double quotes instead one? pattern: "^.{0,72}(\n.*)*$" and I think these parameters should be with double quotes excludeTitle: "true"
excludeDescription: "true"
checkAllCommitMessages: "true" |
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
@dtcMLOps Haha, you never know ^^ but in this case, using double quotes did not do the trick: Also tried to use double quotes for the three parameters but that didn't work out: Tried with my old regex too, without success. |
… long, I mean, really tooooooo long! This change makes sure we always check the latest commit message and not an outdated one. This is needed for updated RPs. GsActions/commit-message-checker#95
Code of Conduct
Is there an existing issue for this?
GitHub-hosted runner
ubuntu-latest
Additional runner information
No response
Current Behavior
I set up a commit-message-checker workflow to check the commit message of a Pull request.
The pattern is to make sure the message begin with certain formatted text.
Then I send a PR with a commit message that doesn't match the pattern, the workflow
detects it and give failure result.
Then I updated the commit's message to something that matches the pattern (locally, run
git comment --amend
to modify the commit message) and force pushed the commit to repository. The workflow re-triggered automatically. However it still use the old commit message and failed the workflow.Expected Behavior
I'd expect the workflow could pick up my commit updates and give a successful workflow result.
Steps To Reproduce
Anything else?
It would be always check the updated commit message rather than the original one.
The text was updated successfully, but these errors were encountered: