Skip to content

chore: add workflow to purge deployments safely - #7

Merged
Artisa111 merged 1 commit into
mainfrom
copilot/fix-2b964a25-e8d7-4596-a5b6-8deb1734f27c
Aug 18, 2025
Merged

chore: add workflow to purge deployments safely#7
Artisa111 merged 1 commit into
mainfrom
copilot/fix-2b964a25-e8d7-4596-a5b6-8deb1734f27c

Conversation

Copilot AI commented Aug 18, 2025

Copy link
Copy Markdown
Contributor

This PR adds a GitHub Actions workflow and bash script to safely purge all deployments in the repository without deleting environments. The implementation provides a safe, manual process for cleaning up deployment history while preserving environment configurations.

What's Added

🔧 Bash Script (scripts/purge_deployments.sh)

  • Lists all deployments using GitHub REST API with pagination support (100 per page)
  • Marks each deployment as inactive before deletion (safe precondition)
  • Deletes deployments one by one
  • Provides detailed summary showing count per environment and total deleted
  • Uses only curl + jq (no gh CLI dependency)
  • Works with default GITHUB_TOKEN
  • Includes automatic jq installation for Ubuntu runners

⚡ GitHub Actions Workflow (.github/workflows/purge-deployments.yml)

  • Manual trigger only via workflow_dispatch
  • Safety confirmation required: User must type I UNDERSTAND to proceed
  • Proper permissions: contents: read, deployments: write
  • Concurrency control: Prevents multiple simultaneous runs
  • Conditional execution: Only runs when confirmation string matches exactly

Usage Instructions

  1. Navigate to ActionsPurge Deployments
  2. Click Run workflow
  3. Enter I UNDERSTAND in the confirmation field
  4. Click Run workflow to execute

The workflow will:

  • List all existing deployments
  • Mark each as inactive
  • Delete each deployment
  • Print a summary like:
    Deleted deployments summary:
      production: 5
      staging: 12
      development: 8
    Total: 25
    

Safety Features

  • Environments are preserved - only deployments are removed
  • Manual confirmation required - prevents accidental execution
  • Graceful error handling - continues on individual failures
  • Detailed logging - shows exactly what was processed
  • No external dependencies - uses standard GitHub token

This tooling helps maintain a clean deployment history while keeping all environment configurations intact.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Artisa111
Artisa111 marked this pull request as ready for review August 18, 2025 18:43
@Artisa111
Artisa111 merged commit 6f98abc into main Aug 18, 2025
1 check passed
@coderabbitai

coderabbitai Bot commented Aug 18, 2025

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copilot AI changed the title [WIP] chore: add workflow to purge deployments safely chore: add workflow to purge deployments safely Aug 18, 2025
Copilot AI requested a review from Artisa111 August 18, 2025 18:46
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.

2 participants