-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 1.02 KB
/
auto-issue.yml
File metadata and controls
38 lines (33 loc) · 1.02 KB
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
37
38
name: Auto Issue Creator
on:
push:
branches:
- '**'
jobs:
create-issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@v4
- name: Auto create issues from .github/issues.json
uses: actions/github-script@v7
with:
script: |
const todos = require('.github/issues.json');
const existing = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'all'
});
const existingTitles = existing.data.map(i => i.title);
for (const todo of todos) {
if (existingTitles.includes(todo.title)) continue;
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: todo.title,
body: todo.body,
labels: todo.labels
});
}