mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
38 lines
1.0 KiB
YAML
38 lines
1.0 KiB
YAML
name: Clean up closed issues
|
|
|
|
on:
|
|
issues:
|
|
types: [closed]
|
|
|
|
permissions:
|
|
issues: write
|
|
|
|
jobs:
|
|
remove-labels:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Remove feedback label
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const issue = context.payload.issue;
|
|
const hasLabel = issue.labels.some(l => l.name === 'feedback');
|
|
|
|
if (hasLabel) {
|
|
try {
|
|
await github.rest.issues.removeLabel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: issue.number,
|
|
name: 'feedback'
|
|
});
|
|
console.log(`Removed 'feedback' label from issue #${issue.number}`);
|
|
} catch (error) {
|
|
if (error.status === 404) {
|
|
console.log(`Label 'feedback' already removed from issue #${issue.number}`);
|
|
} else {
|
|
throw error;
|
|
}
|
|
}
|
|
}
|