Replies: 17 comments 12 replies
-
@michhyun1 Could you provide some additional information on your scenario? From what I see it feels like you are using environments with approvals and secrets to support a scenario that we have not thought about, but I am not 100% sure exactly what that is. |
Beta Was this translation helpful? Give feedback.
-
I am also finding this frustrating... because I need to protect the deployment environments with reviews and when the workflow is consisting of different jobs that need access to the environment secrets, the workflow requires multiple approvals to get it to proceed, which is a waste of time. I want deployment environment to be able to be configured at the workflow level so that once I have approved the environment deployment all the jobs in that workflow run should progress without repeatedly prompting me for every job in the flow. Right now I've had to rewrite a relatively large 450 line workflow of multiple jobs which appeared nicely in the UI with different job steps into a single monolithic job to avoid this multiple approvals issue due to the lack of being able to set the deployment environment at the workflow level and approve it once in the UI. On a related note, deployment environment support should be added to the reusable workflow level too, see: |
Beta Was this translation helpful? Give feedback.
-
This is such a tedious issue I've just had to rewrite a non-trivial 450 line workflow into a single job to minimize it to one approval for the workflow since each approval takes at least 3 clicks per job otherwise and wastes time waiting for approvals at each job/stage too. You can't even automate around this with GitHub CLI, nor even with the Rest API, so I've just raised a request for them too: |
Beta Was this translation helpful? Give feedback.
-
Hello. Any news on that? Its the end of 2023 and I also have the same problem. I consider one workflow with multiple jobs as deployment and it would be nice to assign environment on workflow level. |
Beta Was this translation helpful? Give feedback.
-
Hello GitHub, can you please find time and check this functionality in GitLab(it's your competitors). Hope you get inspiration. Thanks! |
Beta Was this translation helpful? Give feedback.
-
It's very strange that something like this wasn't done from the beginning. At the moment it's the only thing stopping me from using Environments. |
Beta Was this translation helpful? Give feedback.
-
Any update on this? This causes frustration for our external contributors. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue. It's incredible this isn't at the top of Github's TODO list. |
Beta Was this translation helpful? Give feedback.
-
Would love to see this functionality. |
Beta Was this translation helpful? Give feedback.
-
+1 for adding this functionality. |
Beta Was this translation helpful? Give feedback.
-
This is made particularly awkward for using environments with re-usable workflows because |
Beta Was this translation helpful? Give feedback.
-
I have a similar use case - I use A workflow-level |
Beta Was this translation helpful? Give feedback.
-
+1 Need this |
Beta Was this translation helpful? Give feedback.
-
Definitely need a solution to this. We have a multi job deployment process which we use reusable workflows for. Because of the (seemingly arbitrary) limitation on setting We need to be able to either set For our use case we aren't really using environment secrets, because the lack of org wide environments makes that impractical. However we do want to use environment protection rules and approvals. The extra UI feedback would be useful too. |
Beta Was this translation helpful? Give feedback.
-
This also affects timers. We deploy to our production environment after a 24h timer. (Each environment also has some of its own secrets and variables.) However, the prod deployment consists of Instead, I want the timer to run once for everything the workflow is going to do in the production environment. So I would merge to |
Beta Was this translation helpful? Give feedback.
-
I also have this similar problem, but I have a workaround that:
You can replace this code: jobs:
job1:
runs-on: ubuntu-latest
environment: PROD
steps:
run: echo ${{ vars.VAR1 }}
job2:
runs-on: ubuntu-latest
environment: PROD
steps:
run: echo ${{ vars.VAR2 }} With this code: jobs:
copy_vars:
name: Copy environment vars from Github Env Vars to outputs to avoid multiple approvals
runs-on: ubuntu-latest
environment: PROD
outputs:
VAR1: ${{ steps.vars.outputs.VAR1 }}
VAR2: ${{ steps.vars.outputs.VAR2 }}
steps:
- id: vars
run: |
echo "VAR1=${{ vars.VAR1 }}" >> "$GITHUB_OUTPUT"
echo "VAR2=${{ vars.VAR2}}" >> "$GITHUB_OUTPUT"
job1:
runs-on: ubuntu-latest
needs: copy_vars
steps:
run: echo ${{ needs.copy_vars.outputs.VAR1 }}
job2:
runs-on: ubuntu-latest
needs: copy_vars
steps:
run: echo ${{ needs.copy_vars.outputs.VAR2 }} If you do |
Beta Was this translation helpful? Give feedback.
-
It seems as if I am only able to enable github environments on the Job level. I want to deploy my environment once and have my entire workflow run under that environment.
My use case is the following:
I have a CI workflow that includes one workflow and ~10 jobs (and more will be added soon). Every single job requires a Github Secret. When a pull request is submitted to our main branch, GHA should require a manual deployment to our github environment called
CI Workflow
and once the approval is done - trigger the workflow and run the 10 jobs.However, since the environments is only on the job level, I have to attach the
job.job-id.environment
property to each job. That means, when an external contributor submits a PR against our main branch, it looks like this:The PR is here
Is there a way to deploy the environment only one time, and then run all of the jobs under that environment?
Beta Was this translation helpful? Give feedback.
All reactions