Skip to content

Update package.json #85

Update package.json

Update package.json #85

name: Issue Comments (Created).
on:
issue_comment:
types: [created]
jobs:
remove-label:
name: Remove labels used for tracking issues that a contributor is awaiting a response.
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
console.log(JSON.stringify({
labels: context.payload.issue.labels,
login: context.payload.sender.login
}));
if(context.payload.sender.login === 'neverendingqs') {
// Do not remove labels if a contributor wrote the comment
return;
}
const labels = [
'awaiting response'
];
labels.forEach(label => {
const hasLabel = context.payload.issue.labels
.map(({ name }) => name)
.includes(label);
if(hasLabel) {
github.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: label,
});
}
});