-
Notifications
You must be signed in to change notification settings - Fork 30
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 issue title check #273
Conversation
Signed-off-by: soma00333 <soma03432303@gmail.com>
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.
thank you!
Signed-off-by: soma00333 <soma03432303@gmail.com>
0b4637b
to
79a03d4
Compare
I appreciate your quick review. |
check_title_length: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check issue title length | ||
id: check_length | ||
run: | | ||
TITLE="${{ github.event.issue.title }}" | ||
LENGTH=$(echo -n "$TITLE" | wc -m) | ||
|
||
echo "Title: $TITLE" | ||
echo "Length: $LENGTH" | ||
|
||
if [ "$LENGTH" -ge 60 ]; then | ||
echo "title_is_too_long=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "title_is_too_long=false" >> $GITHUB_OUTPUT | ||
fi |
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.
do this in
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
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.
@mathetake
Okay, I'll switch it to the script
Just to confirm, do we need two steps (1. Check 2. Comment) or just one step (1. Check and Comment)?
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.
Just one step and do all in one script!
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.
Ahh, now I got it.
I missed this comment #273 (comment)
Let me fix
Thank you for your quick response
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.
fixed here cb69514
Signed-off-by: soma00333 <soma03432303@gmail.com>
console.log(`Title: ${issueTitle}`); | ||
console.log(`Length: ${length}`); | ||
|
||
if (length >= 60) { |
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.
Why was this specific value chosen instead of the commonly used 72?
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.
Hi @leseb
Thank you for your comment
There is no particular reason. I think 72 would work just as well.
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.
Just to clarify, a 72-character limit is common for commit messages, not GitHub issues. This is the first time I’ve seen such enforcement. IMO, if a bot must enforce a length, a more flexible cap (like 80 characters) would be better than something as restrictive as 60. My 2 cents.
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.
Your opinion makes sense
We should consider this, thank you
@mathetake
Should we enforce a stricter character limit (current 60), or should it be more flexible (like 80)?
Since GitHub Actions only writes a comment on the issue, I think strict (60) is fine.
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.
so i don't care about what is "right" but just i hate multi line issue titles. and as you guys see 72 is a typical characters for git commits, not issues. For that purpose, 60 satisfies and I guess 72 doesn't (GitHub UI can change at any moment without out control though.) So let's go ahead with 60 and see how other people say - i am 100% open to change it later!
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.
Thank you for multiple iterations @soma00333 + thanks @leseb for your input as always
Thank you for your deep insight, both |
**Commit Message** This introduces a new GitHub Actions workflow to check the length of issue titles and provide feedback if they exceed a specified limit. **Related Issues/PRs (if applicable)** Fixes envoyproxy#270 --------- Signed-off-by: soma00333 <soma03432303@gmail.com> Signed-off-by: Eric Mariasis <ericmariasis829@gmail.com>
**Commit Message** This introduces a new GitHub Actions workflow to check the length of issue titles and provide feedback if they exceed a specified limit. **Related Issues/PRs (if applicable)** Fixes envoyproxy#270 --------- Signed-off-by: soma00333 <soma03432303@gmail.com> Signed-off-by: Erica Hughberg <erica.sundberg.90@gmail.com>
**Commit Message** This introduces a new GitHub Actions workflow to check the length of issue titles and provide feedback if they exceed a specified limit. **Related Issues/PRs (if applicable)** Fixes envoyproxy#270 --------- Signed-off-by: soma00333 <soma03432303@gmail.com> Signed-off-by: Loong <long0dai@foxmail.com>
Commit Message
This introduces a new GitHub Actions workflow to check the length of issue titles and provide feedback if they exceed a specified limit.
Related Issues/PRs (if applicable)
Fixes #270
Special notes for reviewers (if applicable)
.github/workflows/issue_title_check.yaml
: Created a new workflow named "Issue Title Check" that triggers on issue creation and edits. It includes two jobs:check_title_length
to validate the title length andcomment_if_long
to leave a comment if the title is too long.I checked the behavior with the forked repository.