Skip to content

Instantly share code, notes, and snippets.

@zodman
Created October 30, 2020 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zodman/55a0fac7e83deae3c1c8d5687993e303 to your computer and use it in GitHub Desktop.
Save zodman/55a0fac7e83deae3c1c8d5687993e303 to your computer and use it in GitHub Desktop.
store github secrets from env enviroment
import sys
from dotenv import dotenv_values
"""
# pip install python-dotenv
# using https://github.com/anomaly/github-secrets-cli
main.py .secretsenv org repo | bash
"""
def main():
e =dotenv_values(dotenv_path=sys.argv[1])
org = sys.argv[2]
repo = sys.argv[3]
for k,v in e.items():
print(f'ghs secrets:set -s {k} -i {v} -o {org} -r {repo}')
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment