Stop PR in case of forbidden label (#8508)

* stop PR in case of forbidden label

* sync PR

* add tmp workflow

* add tmp workflow

* add tmp workflow

* checkout repo
This commit is contained in:
Maurizio Vitale
2023-04-24 16:10:11 +01:00
committed by GitHub
parent 40db12fd3c
commit 17631d0b48
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
module.exports = async ({ github, context, checkLabels }) => {
const { data: issue } = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const labels = issue.labels?.map(item => item.name);
if (checkLabels.some(i => labels.includes(i))) {
return true;
}
return false;
}