Create environment for repository using gh

Viewed 297
1 Answers

From what I'm seeing here in the gh cli repo that's going to be a no at this time. The issue [linked] is an enhancement request for just that.

I too wanted to know if this could be done, as it's part of my workflow to inject environment secrets.

You can still use the API to create it though.

curl -X PUT \
-H 'Authorization: Bearer ghp_...' \
-H 'Accept: application/vnd.github.v3+json' \
https://api.github.com/repos/<org>/<repo>/environments/<env>
Related