Github cli extension to approve or reject pending deployments that are waiting for review.

gh-deploy

A gh cli extension to approve or reject pending deployments that are waiting for review.

Installation

Installation requires a minimum version (2.0.0) of the the Github CLI to support extensions.

  1. Install the gh cli - see the installation/upgrade instructions

  2. Install this extension:

gh extension install yuri-1987/gh-deploy

Usage

gh deploy --help

Usage:
  gh-deploy [OPTIONS]

Application Options:
  -r, --repo=    Github reposiory name including owner
  -e, --env=     Github environment name
  -i, --run-id=  Github Action run id to approve
      --approve  Approve deployment
      --reject   Reject deployment

Help Options:
  -h, --help     Show this help message

To approve pending deployment by run-id:

gh deploy --env prod --run-id 1723641358 --repo "yuri-1987/tf-iac" --approve

To reject pending deployment by run-id:

gh deploy --env prod --run-id 1723641358 --repo "yuri-1987/tf-iac" --reject

Use cases

Set environment protection rules for your Github repository, ie. prod environment requires a review from your team members.

send them a slack message with the details of the deployment via github action.

workflow snippet:

To *approve*, run: ``` gh deploy --env prod --run-id ${{ github.run_id }} --repo "${{ github.repository }}" --approve ``` To *reject*, run: ``` gh deploy --env prod --run-id ${{ github.run_id }} --repo "${{ github.repository }}" --reject ``` <{{diffUrl}}|Link to PR diff in branch: `{{branch}}`>">
deployment_job_name:
  runs-on: ubuntu-latest
  steps:
    - name: send slack message for approval
      uses: act10ns/[email protected]
      with:
        status: "tf prod waiting for approval"
        channel: '#deployments'
        message: |
          *Terraform Apply for Production env in `${{ github.repository }}` is pending approval*
          Review requested by ${{ github.actor }}
          Please review it here: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>
          To *approve*, run:
          ```
          gh deploy --env prod --run-id ${{ github.run_id }} --repo "${{ github.repository }}" --approve
          ```
          To *reject*, run:
          ```
          gh deploy --env prod --run-id ${{ github.run_id }} --repo "${{ github.repository }}" --reject
          ```
          <{{diffUrl}}|Link to PR diff in branch: `{{branch}}`>
Similar Resources

being a gh extension that runs animated terminal "screensavers"

gh-screensaver being a gh extension that runs animated terminal "screensavers" usage gh screensaver run a random screensaver gh screensaver -s pipes r

Nov 29, 2022

gh extension for bumping version of a repository

gh extension for bumping version of a repository

gh bump a gh extension for bumping version of a repository. Usage gh bump with another repository. gh bump -R repository Installation gh extension

Dec 14, 2022

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Dec 31, 2022

CLI tool for manipulating GitHub Labels across multiple repositories

takolabel Installation Mac $ brew install tommy6073/tap/takolabel Other platforms Download from Releases page in this repository. Usage Set variables

Nov 3, 2022

CLI to output stargazer ⭐️ histogram for a GitHub repository

bestgo bestgo is a CLI that pulls live data from https://api.bestofgo.dev (UI coming soon). This is an application that scrapes GitHub data for Go rep

Jun 30, 2022

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Feb 5, 2022

A cli that shows a GitHub-like language usage statistics bar.

A cli that shows a GitHub-like language usage statistics bar.

barley A cli that shows a GitHub-like language usage statistics bar. barley analyses the programming languages used in a directory and creates a used

Jan 8, 2022

Github-org-diff - Simple CLI tool to check a diff between 2 branches of all org repos

github-org-diff Simple CLI tool to list org repos that have diff between dev and

Jan 25, 2022

A CLI tool for communicating with github.

go-github A Golang CLI tool built with Cobra (& cobra-cli). Pre-requisites Go SDK Getting started You can decide to do one of two things: Clone the re

Jul 31, 2022
Waiton - Commandline for executing command and waiting on output

waiton Commandline for executing command and waiting on output Output of waiton

Feb 4, 2022
A command-line to create a pull request to review the entire content of a Github repository.

Pull Request Me Pull Request Me (PRMe) creates a pull request for the entire content of a Github repository. This is useful to solicit review comments

Nov 2, 2021
cTRL is a server for remote execution of pending tasks and commands in real time, supporting a queue with continuous thread limiting and throttling.

Документация на русском: https://github.com/eltaline/ctrl/blob/master/README-RUS.md cTRL is a server written in Go language that uses a modified versi

Mar 3, 2022
cTRL: a server for remote execution of pending tasks and commands in real time

Документация на русском: https://github.com/eltaline/ctrl/blob/master/README-RUS.md cTRL is a server written in Go language that uses a modified versi

Mar 3, 2022
A CLI tool to manage and streamline AWS ECS deployments

Outback CLI ?? About The Project Outback is CLI tool written in Go to help streamline the process of deploying containerized applications to AWS Elast

Dec 8, 2021
An extension for the GitHub Cli application that displays your current contribution graph
An extension for the GitHub Cli application that displays your current contribution graph

gh-graph An extension for the GitHub Cli application that displays your current contribution graph in the terminal (logged out contribution graph) Ins

Sep 29, 2021
GitHub CLI extension to create and revoke installation tokens

GitHub CLI extension to create and revoke installation tokens.

Nov 22, 2021
A GitHub CLI extension to view and generate license files.

gh-license A GitHub CLI extension to view and generate license files. All license information is obtained from the GitHub API. NOTE: The only purpose

Oct 8, 2022
GitHub CLI extension to clone (or update) all repositories in an Organization, with the ability to filter via search queries.

gh-org-repo-sync GitHub CLI extension to clone all repositories in an Organization, with the ability to filter via search queries. If a local clone al

Nov 2, 2022
Ghissue - This repo contains a github issue parser, that is useful for Enterprise Github accounts.

Ghissue - This repo contains a github issue parser, that is useful for Enterprise Github accounts. Sometimes is needed to parse the content of the issue for some data extraction or statistics purposes.

Feb 6, 2022