-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add CI Check for Validating PR Template #9782
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
Conversation
This PR adds a GitHub Actions workflow to automatically validate that pull requests follow the required PR template format.
Now you can see in this pr also |
const urlMatch = /https?:\/\/[^\s)]+/i.exec(body); | ||
const urlValid = urlMatch && /^https?:\/\/[^\s]+$/.test(urlMatch[0]); |
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 going to match the no content / terms and conditions links, not check that the user has actually provided a link
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.
Ya I will make changes
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.
Can we move this into the existing validate.yml
workflow, renaming the existing job to cnames_active
and this one to pr_template
?
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.
Ok
@MattIPv4 Hey can you check and verify once Added
and also move this into existing validate.yml |
Co-authored-by: Matt Cowley <me@mattcowley.co.uk>
Co-authored-by: Matt Cowley <me@mattcowley.co.uk>
Co-authored-by: Matt Cowley <me@mattcowley.co.uk>
Co-authored-by: Matt Cowley <me@mattcowley.co.uk>
Suggested All Changes Updated |
@indus does this seem fine to you? Branch protection will need updating to the new check names to allow this to merge |
@MattIPv4
We currently only have the validate step in the branch protection: But as I understand it the new checks should be made when a PR gets opened, right? What do I have to do to make this work? |
I mean is the idea to give the user feedback on what is missing or is it just to disable the merge button as long as the checks show stuff is missing in the PR (which is a good thing on its own)? New requesters need to be approved before the workflow runs and tend to ignore the outcome of the CI without a without a direct request telling them what they need to change. Would it be possible to automatically add such a comment in the PR with |
Currently this is only going to block merging + show a failure in the Actions run, but I do agree a good follow-up would be to have it automatically comment to ask them for whatever was missing.
That existing validate check requirement needs to be removed, and then the new validate-cnames + validate-pr-template checks need to be added. I have access to do that 👍 |
This PR adds a GitHub Actions workflow to automatically validate that pull requests follow the required PR template format. This ensures better PR hygiene and consistency by preventing incorrectly filled-out pull requests from being merged. This resolves #9449.
Checks implemented:
✅ PR description includes both required checkboxes:
✅ A valid-looking URL is present in the PR body
✅ A non-trivial explanation (at least 10 characters) is included under the content description section
A demo can be seen at https://github.com/mraxays/js.org/pull/1