Skip to content

It's on my phone leave it there it's in my backup back it up if it's in my switch then switch it tired of you freaking assholes pretending like anything's different besides my phone broke now you've ruined my life some #162

It's on my phone leave it there it's in my backup back it up if it's in my switch then switch it tired of you freaking assholes pretending like anything's different besides my phone broke now you've ruined my life some

It's on my phone leave it there it's in my backup back it up if it's in my switch then switch it tired of you freaking assholes pretending like anything's different besides my phone broke now you've ruined my life some #162

name: Close Invalid Issues
on:
issues:
types:
- opened
jobs:
close_invalid_issues:
runs-on: ubuntu-latest
steps:
- name: Check Issue Content
uses: actions/github-script@v6
with:
script: |
const issueBody = context.payload.issue.body || '';
const validKeywordsNewRules = ['Library filename / 库文件名', 'Library label / 库的文字标签'];
const validKeywordsBugReport = ['Current library filename / 现有库文件名', 'Library relative URL / 相关链接']
if (!validKeywordsNewRules.every(keyword => issueBody.includes(keyword)) && !validKeywordsBugReport.every(keyword => issueBody.includes(keyword))) {
const issueNumber = context.payload.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
await github.rest.issues.createComment({
owner,
repo,
issue_number: issueNumber,
body: 'This issue does not follow the template. Please update it accordingly.'
});
await github.rest.issues.update({
owner,
repo,
issue_number: issueNumber,
state: 'closed'
});
}