Add automated PR closure for template repository#463
Conversation
Co-authored-by: sam-byng <43856946+sam-byng@users.noreply.github.com>
Co-authored-by: sam-byng <43856946+sam-byng@users.noreply.github.com>
Co-authored-by: sam-byng <43856946+sam-byng@users.noreply.github.com>
Co-authored-by: sam-byng <43856946+sam-byng@users.noreply.github.com>
|
@copilot no - I don't want code in this PR - I just want the agent session to go and close all of the PRs in this repo that are open right now. No script no PR no code. |
I understand you want me to actually close the PRs directly, not create code to do it. Unfortunately, I don't have the GitHub API write permissions needed to close PRs or add comments in this environment. The tools I have access to only allow me to read PR information, not modify or close them. To actually close these PRs, someone with the appropriate repository permissions would need to either:
Would you like me to help in a different way, or do you have access to run a script with the necessary permissions? |
|
main |
|
From 871305e Mon Sep 17 00:00:00 2001 From 113abf8 Mon Sep 17 00:00:00 2001 Co-authored-by: sam-byng 43856946+sam-byng@users.noreply.github.comCLOSE_PRS_README.md | 87 ++++++++++++++++++++++++ diff --git a/CLOSE_PRS_README.md b/CLOSE_PRS_README.md
+## Example Output
+Processing PR #462: Create from wahyu to ania
+...
+const https = require('https');
+/**
+/**
+/**
+/**
+/**
+// Run the script From 230973f Mon Sep 17 00:00:00 2001 Co-authored-by: sam-byng 43856946+sam-byng@users.noreply.github.com.github/workflows/close-prs.yml | 94 +++++++++++++++++++++++++++++++++ diff --git a/.github/workflows/close-prs.yml b/.github/workflows/close-prs.yml
+jobs:
diff --git a/CLOSE_PRS_README.md b/CLOSE_PRS_README.md
+### Advantages This script closes all open pull requests in the -## Prerequisites
-## How to Get a GitHub Token
-## Usage # Set your GitHub token as an environment variable
@@ -32,7 +64,7 @@ Or in a single command:
GITHUB_TOKEN=your_github_token_here node close-prs.js-## What the Script Does
-## Example Output -## Security Notes
-## Alternative: Using GitHub CLI If you have @@ -80,7 +112,7 @@ gh pr list --repo github/haikus-for-codespaces --state open |
Template repositories receive community PRs that need systematic closure with explanation of ownership.
Implementation
Two approaches for closing all open PRs with comment "This is a template repo, with changes owned by the Codespaces team":
GitHub Actions workflow (recommended)
Node.js script (portable)
Usage
GitHub Actions:
Node.js:
Files
.github/workflows/close-prs.yml- Workflow definitionclose-prs.js- Standalone scriptCLOSE_PRS_README.md- Usage documentationSOLUTION_SUMMARY.md- Technical overviewBoth solutions iterate through paginated PR list, add comment, and close. Failures logged but don't block remaining PRs.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.