forked from envoyproxy/ai-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 1.01 KB
/
issue_title_check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Issue Title Check
on:
issues:
types: [opened, edited]
permissions:
issues: write
jobs:
check_title_length:
runs-on: ubuntu-latest
steps:
- name: Check Issue Title Length
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueNumber = context.issue.number;
const repoOwner = context.repo.owner;
const repoName = context.repo.repo;
const issueTitle = context.payload.issue.title;
const length = issueTitle.length;
console.log(`Title: ${issueTitle}`);
console.log(`Length: ${length}`);
if (length >= 60) {
await github.rest.issues.createComment({
owner: repoOwner,
repo: repoName,
issue_number: issueNumber,
body: "The issue title is too long (over 60 characters). Please shorten it and ensure it is well summarized."
});
}