Skip to content

Commit

Permalink
Update close all issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjaliavv51 authored Dec 20, 2024
1 parent 9d4a8e0 commit 1aa870b
Showing 1 changed file with 62 additions and 26 deletions.
88 changes: 62 additions & 26 deletions .github/workflows/close all issues
Original file line number Diff line number Diff line change
@@ -1,31 +1,67 @@
name: Close All Issues

name: Close Issues
on:
workflow_dispatch: # Allows the workflow to be triggered manually
workflow_dispatch:

jobs:
close_issues:
close-issues:
runs-on: ubuntu-latest

steps:
- name: Close all open 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' // Fetch only open issues
});

for (const issue of issues) {
if (issue.pull_request) { // Ensure it’s an issue, not a pull request
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed'
});
console.log(`Closed issue #${issue.number}: ${issue.title}`);
}
}
- name: Close Issue #839
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_issue
client-payload: '{"issue_number": 839}'

- name: Close Pull Request #625
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_pull_request
client-payload: '{"pull_number": 625}'

- name: Close Pull Request #615
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_pull_request
client-payload: '{"pull_number": 615}'

- name: Close Issue #838
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_issue
client-payload: '{"issue_number": 838}'

- name: Close Pull Request #670
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_pull_request
client-payload: '{"pull_number": 670}'

- name: Close Pull Request #810
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_pull_request
client-payload: '{"pull_number": 810}'

- name: Close Pull Request #626
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_pull_request
client-payload: '{"pull_number": 626}'

- name: Close Pull Request #805
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_pull_request
client-payload: '{"pull_number": 805}'

- name: Close Issue #836
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_issue
client-payload: '{"issue_number": 836}'

- name: Close Pull Request #695
uses: peter-evans/repository-dispatch@v1
with:
event-type: close_pull_request
client-payload: '{"pull_number": 695}'

0 comments on commit 1aa870b

Please sign in to comment.