PowerShell DotEnv to GitHub Encrypted secrets
This is a simple script to exports environment variable from the .env file to the GitHub Encrypted secrets.
Add the function Set-GitHubSecrets to the prompt function.
Set-GitHubSecrets
Remove-GitHubSecrets
# This is function is called by convention in PowerShell
function prompt {
Set-GitHubSecrets
Remove-GitHubSecrets
}
Create a .env file at the folder level the environment variable has to be exported
Sample .env file
#This is a comment
#Assign a variable
DEPLOYKEY=KEY1
#github-secrets-skip Next var will be ignored
LOCALVAR=NOTFORGITHUB
Install-Module -Name Set-GitHubSecrets