mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-04-26 00:26:21 +02:00
Add GitHub Actions workflows for issue deduplication and auto-close
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
This commit is contained in:
parent
f56261cee1
commit
b3cb9531a4
7 changed files with 1013 additions and 0 deletions
48
.github/workflows/remove-autoclose-label.yml
vendored
Normal file
48
.github/workflows/remove-autoclose-label.yml
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# Removes the "autoclose" label whenever a human (non-bot) posts a new comment
|
||||
# on an issue that carries the label. This resets the inactivity clock.
|
||||
name: Remove Autoclose Label on Human Activity
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
remove-autoclose:
|
||||
# Only run for issue comments (not PR comments)
|
||||
if: ${{ github.event.issue.pull_request == null }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Remove autoclose label if human commented
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const actor = context.actor;
|
||||
|
||||
// Ignore bot accounts
|
||||
if (actor.endsWith('[bot]') || actor === 'github-actions') {
|
||||
core.info(`Skipping bot comment from ${actor}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const issue = context.payload.issue;
|
||||
const labels = (issue.labels || []).map(l => l.name);
|
||||
|
||||
if (!labels.includes('autoclose')) {
|
||||
core.info('Issue does not have "autoclose" label – nothing to do.');
|
||||
return;
|
||||
}
|
||||
|
||||
await github.rest.issues.removeLabel({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
name: 'autoclose',
|
||||
});
|
||||
|
||||
core.info(
|
||||
`Removed "autoclose" label from #${issue.number} ` +
|
||||
`after human activity by ${actor}`
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue