microsoft / AzureTRE-Deployment

MIT License
11 stars 22 forks source link

config.yaml to github secrets #60

Open chboudry opened 1 year ago

chboudry commented 1 year ago

It would be nice to add a script to avoid manually create the GH secrets.

here is what I am using :

gh auth login
repo="name/AzureTRE-Deployment"
env="CICD"
ghvar=$(cat ./config.yaml | grep ":" | grep -v -e '#' | grep -v -e ':$' | sed 's/ //g')
for fn in $ghvar; 
do 
    parameter=$(echo $fn |cut -d ":" -f 1)
    value=$(echo $fn |cut -d ":" -f 2)
    gh secret set $parameter -b $value --repo $repo  --env $env
done
Danny-Cooke-CK commented 1 month ago

This could be very useful to add into the make file scripts