Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjaliavv51 committed Dec 21, 2024
1 parent 194e330 commit 4520419
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 31 deletions.
51 changes: 21 additions & 30 deletions .github/workflows/close all issues
Original file line number Diff line number Diff line change
@@ -1,41 +1,32 @@
name: Close All Open Issues
name: Close All Issues

on:
workflow_dispatch: # Allows manual triggering of this workflow

permissions:
issues: write # Grants write permission to manage issues
workflow_dispatch:

jobs:
close_issues:
runs-on: ubuntu-latest

steps:
- name: Close all open issues
- name: Checkout code
uses: actions/checkout@v3

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

if (issues.length === 0) {
console.log("No open issues found.");
} else {
console.log(`Found ${issues.length} open issues.`);
for (const issue of issues) {
if (!issue.pull_request) { // Skip pull requests
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}`);
} else {
console.log(`Skipped pull request #${issue.number}`);
}
}
}
for (const issue of issues.data) {
await github.rest.issues.update({
owner,
repo,
issue_number: issue.number,
state: 'closed'
});
console.log(`Issue #${issue.number} closed.`);
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"liveServer.settings.port": 5504
"liveServer.settings.port": 5504,
"IDX.aI.enableInlineCompletion": true,
"IDX.aI.enableCodebaseIndexing": true
}

0 comments on commit 4520419

Please sign in to comment.