Skip to content

yuramanga.my.id

yuramanga.my.id #889

name: Remove 'Needs more info' labels on issue closed
on:
issues:
types: [closed]
jobs:
remove_label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var owner = context.repo.owner;
var repo = context.repo.repo;
var issue_number = context.issue.number;
var needsMoreInfo = 'needs-more-info';
var issueLabelsRaw = await github.issues.listLabelsOnIssue({
owner,
repo,
issue_number,
});
var issueLabels = issueLabelsRaw.data
.map((el) => el.name);
if (issueLabels.indexOf(needsMoreInfo) > -1) {
github.issues.removeLabel({
owner,
repo,
issue_number,
name: needsMoreInfo,
});
}