mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 02:48:34 +00:00
parent
53cc82b132
commit
ab34342664
1 changed files with 32 additions and 0 deletions
32
.github/workflows/close_unlabeled_issues.yml
vendored
Normal file
32
.github/workflows/close_unlabeled_issues.yml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: Close Unlabeled Issues
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
close-unlabeled-issue:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check for labels and close if unlabeled
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
const issue = context.payload.issue;
|
||||
if (issue.labels.length === 0) {
|
||||
const issueNumber = issue.number;
|
||||
await github.rest.issues.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber,
|
||||
state: 'closed'
|
||||
});
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issueNumber,
|
||||
body: 'This issue has been automatically closed because it was created without using an issue template. Please reopen your issue using one of the following issue templates:\n\nhttps://github.com/zed-industries/zed/issues/new/choose'
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue