Skip to content

Auto-close issues on successful gist operations#43

Merged
caibingcheng merged 4 commits intomasterfrom
copilot/update-manage-gist-workflow
Dec 31, 2025
Merged

Auto-close issues on successful gist operations#43
caibingcheng merged 4 commits intomasterfrom
copilot/update-manage-gist-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 31, 2025

The workflow posts comments on success but leaves issues open. This adds automatic issue closure when ADD/DELETE operations complete successfully.

Changes

  • Added close_issue() function: PATCH request to GitHub API to close issues with proper error handling
  • Close on successful operations: Issues close after successful ADD/DELETE to gist
  • Close on idempotent operations: Issues close when desired state already exists (URL already present for ADD, URL already absent for DELETE)
  • Preserve failure behavior: Issues remain open on failures (inaccessible URLs, gist update errors)

Example Flow

# Before: Issue remains open after success comment
post_comment(repo, issue_number, "✅ Successfully added URL", token)

# After: Issue automatically closes
post_comment(repo, issue_number, "✅ Successfully added URL", token)
close_issue(repo, issue_number, token)

No permission changes required - workflow already has issues: write.

Original prompt

更新.github/workflows/manage-gist.yml,当操作成功时,close issue


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
rssblog Ready Ready Preview, Comment Dec 31, 2025 0:41am

Copilot AI changed the title [WIP] Update manage-gist.yml to close issue on success Auto-close issues on successful gist operations Dec 31, 2025
Copilot AI requested a review from caibingcheng December 31, 2025 12:42
@caibingcheng caibingcheng marked this pull request as ready for review December 31, 2025 12:45
Copilot AI review requested due to automatic review settings December 31, 2025 12:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds automatic issue closure functionality to the gist management workflow. When ADD or DELETE operations complete successfully or when the desired state already exists (idempotent operations), the corresponding GitHub issue will be automatically closed.

Key changes:

  • Added a new close_issue() helper function that closes GitHub issues via the API
  • Integrated issue closure into success and idempotent operation paths
  • Issues remain open on failures, allowing users to retry or investigate

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@caibingcheng caibingcheng merged commit 1f5ea86 into master Dec 31, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants