Skip to content

Commit

Permalink
Create close all issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjaliavv51 authored Dec 20, 2024
1 parent 4401443 commit 0dbf901
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/close all issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Close All Issues

on:
workflow_dispatch: # Allows you to manually trigger the workflow

jobs:
close_issues:
runs-on: ubuntu-latest

steps:
- name: Close all issues
uses: actions/github-script@v6
with:
script: |
const issues = await github.paginate(github.rest.issues.listForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open'
});

for (const issue of issues) {
if (!issue.pull_request) { // Ensure it's an issue, not a PR
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed'
});
}
}

0 comments on commit 0dbf901

Please sign in to comment.