Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: approve environment deployments for GitHub Actions workflows #5773

Open
HariSekhon opened this issue Jun 8, 2022 · 11 comments
Open
Labels
enhancement a request to improve CLI gh-run relating to the gh run command gh-workflow relating to the gh workflow command help wanted Contributions welcome

Comments

@HariSekhon
Copy link

HariSekhon commented Jun 8, 2022

Describe the feature or problem you’d like to solve

Approve GitHub Actions workflows deployments from the CLI.

Proposed solution

It will make it quicker and easier to approve environment deployments, which at the moment it takes at least 3 clicks per deployment approval per job in the workflow.

This feature would alleviate when there are multiple approvals needed for a single workflow due to it containing multiple jobs, which can quickly become tedious (see community/community#14417) because it can then be more easily automated.

Additional Information

Other related tickets: #5541 #5149

It looks like gh deployment subcommand feature is needed in general.

@HariSekhon HariSekhon added the enhancement a request to improve CLI label Jun 8, 2022
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Jun 8, 2022
@HariSekhon HariSekhon changed the title Support approving environment deployments for GitHub Actions workflows Feature: approve environment deployments for GitHub Actions workflows Jun 8, 2022
@HariSekhon
Copy link
Author

HariSekhon commented Jun 8, 2022

Looks like the Rest API may not support this yet either, so I've just requested it be added to the API so the CLI can support this:

community/community#18088

@mislav
Copy link
Contributor

mislav commented Jun 9, 2022

Thanks for your feature request and for requesting the API separately in the community forum!

Without an API, we can't add this feature to CLI. Therefore, I will close this in favor of ongoing threads in the community org. Feel free to reopen once an API is available 👌

@mislav mislav closed this as completed Jun 9, 2022
@relsqui
Copy link

relsqui commented Aug 26, 2022

I'm not sure whether it existed when this issue was opened, but this appears to be an endpoint that would enable this feature (which I would also love): https://docs.github.com/en/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run

@HariSekhon
Copy link
Author

@mislav I don't think I have permissions to re-open this issue now the API support is available, can you please re-open it?

@samcoe samcoe reopened this Aug 29, 2022
@samcoe samcoe added discuss Feature changes that require discussion primarily among the GitHub CLI team and removed needs-triage needs to be reviewed labels Aug 29, 2022
@mislav
Copy link
Contributor

mislav commented Sep 7, 2022

@HariSekhon Thanks for updating the thread! Would you imagine this functionality to live under our current Actions commands, e.g. gh run <command>, or under a hypothetical gh deployment command that offers general tasks for managing deployments? We've briefly considered adding deployment-related functionality, but we've opted against it due to lack of resources and hoped that maybe someone creates an extension for it: #5541

@mislav mislav removed the discuss Feature changes that require discussion primarily among the GitHub CLI team label Sep 7, 2022
@HariSekhon
Copy link
Author

HariSekhon commented Sep 9, 2022

@mislav I'd go with gh deployment

@vilmibm vilmibm added the help wanted Contributions welcome label Jun 21, 2023
@andyfeller andyfeller added gh-workflow relating to the gh workflow command gh-run relating to the gh run command labels Oct 2, 2023
@jdavredbeard
Copy link

It would be more intuitive to me for this functionality to be under gh run or gh workflow since not all GHA actions are necessarily deployments (and also my org isn't using the deployments functionality)... I'm interested in giving this code a shot

@samcoe
Copy link
Contributor

samcoe commented Oct 16, 2023

@jdavredbeard Can you explain a bit more about how your org is using workflow approvals? From my understanding you can only implement them using deployment protection rules. Unless you are talking about approving workflow runs on a pull request, which is a different feature?

@jdavredbeard
Copy link

jdavredbeard commented Oct 17, 2023

Ah, I guess I am not using GitHub terminology correctly - I am referring to this feature https://docs.github.com/en/actions/managing-workflow-runs/reviewing-deployments - however, the way we are using it, our 'environment' is not a reference to a deployment environment, it is simply called 'manual approval' - any GHA job that needs a simple manual approval from anyone on the team references that same environment. I hadn't investigated the full feature set of deployments yet as we haven't needed them. Whoops! The way I would intuitively think about it, the feature of approving a job would be under workflows or runs, not deployments - but I suppose that would go against the grain of the way GitHub is categorizing these concepts.

@samcoe
Copy link
Contributor

samcoe commented Oct 18, 2023

Yeah the nomenclature of these features can be a confusing to say the least. We do want to keep consistent with the other GitHub products thought so putting this feature under a new deployment command makes the most sense I think.

@BrettMoan
Copy link

gh run says

List, view, and watch recent workflow runs from GitHub Actions.

its doing most of what one does on the UI for workflows, with the exception of the approving of deployments as part of a workflow.

I think putting this under gh run is the right place, especially since when you run gh workflow view <some_workflow> you see at the bottom:

To see more runs for this workflow, try: gh run list --workflow <>.yaml
To see the YAML for this workflow, try: gh workflow view <>.yaml --yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to improve CLI gh-run relating to the gh run command gh-workflow relating to the gh workflow command help wanted Contributions welcome
Projects
None yet
Development

No branches or pull requests

10 participants