/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
.github/workflows/issues.yml
29 строк
869 B
chrisnojima
action write issues (#27996)
25 сен 2024, 15:59
Не верифицирован
25 сен 2024, 15:59
578b8d8
Код
Авторство
О чём код?
name: Close Issues on: issues: types: [opened] permissions: issues: write jobs: close_issue: runs-on: ubuntu-latest steps: - name: Check issue body and close if necessary uses: actions/github-script@v7.0.1 with: script: | const issueBody = context.payload.issue.body || ''; const regex = /345567/; if (!regex.test(issueBody)) { await github.rest.issues.update({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, state: 'closed' }); console.log(`Issue #${context.issue.number} closed because it did not match the regex.`); } else { console.log(`Issue #${context.issue.number} remains open because it matches the regex.`); }