Skip to content

Commit 8be8b62

Browse files
authored
ci(vouch): close approved request discussions (#2929)
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 4e99209 commit 8be8b62

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/DISCUSSION_TEMPLATE/vouch-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body:
88
99
OpenShell uses a vouch system for first-time contributors. Fill out this
1010
form to request approval. A maintainer will review and comment `/vouch`
11-
if approved.
11+
if approved. Approved requests are closed automatically.
1212
1313
**Write in your own words.** Do not have an AI generate this request.
1414
Requests that read like LLM output will be denied.

.github/workflows/vouch-command.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ jobs:
5353
await github.graphql(mutation, { discussionId, body });
5454
}
5555
56+
async function closeDiscussion() {
57+
const discussionId = await getDiscussionId();
58+
const mutation = `mutation($discussionId: ID!) {
59+
closeDiscussion(input: {discussionId: $discussionId}) {
60+
discussion { id }
61+
}
62+
}`;
63+
await github.graphql(mutation, { discussionId });
64+
}
65+
5666
// --- Authorization ---
5767
5868
let isMaintainer = false;
@@ -134,6 +144,7 @@ jobs:
134144
await postDiscussionComment(
135145
`@${discussionAuthor} is already vouched. They can submit pull requests.`
136146
);
147+
await closeDiscussion();
137148
return;
138149
}
139150
@@ -185,4 +196,6 @@ jobs:
185196
'Please read [CONTRIBUTING.md](https://github.com/NVIDIA/OpenShell/blob/main/CONTRIBUTING.md) before submitting.',
186197
].join('\n'));
187198
188-
console.log(`Vouched ${discussionAuthor} (approved by ${commenter}).`);
199+
await closeDiscussion();
200+
201+
console.log(`Vouched ${discussionAuthor} (approved by ${commenter}) and closed the discussion.`);

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ We use a vouch system. This exists because AI makes it trivial to generate plaus
2525
1. Open a [Vouch Request](https://github.com/NVIDIA/OpenShell/discussions/new?category=vouch-request) discussion.
2626
2. Describe what you want to change and why.
2727
3. Write in your own words. AI-generated vouch requests will be denied.
28-
4. A maintainer will comment `/vouch` if approved.
28+
4. A maintainer will comment `/vouch` if approved, and the request discussion
29+
will close automatically.
2930
5. Once vouched, you can submit pull requests.
3031

3132
**If you are not vouched, any pull request you open will be automatically closed.** Org members and collaborators with push access bypass this check.

0 commit comments

Comments
 (0)