Created
August 15, 2024 11:46
-
-
Save jun784/cd5fe0e271fb429b367e57f8425ba0de to your computer and use it in GitHub Desktop.
add-secret-to-gh.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# .env.localファイルを読み込む | |
set -a | |
source .env.local | |
set +a | |
# GitHubリポジトリの情報 | |
REPO_OWNER="your-username" | |
REPO_NAME="your-repo" | |
# 環境変数をGitHubシークレットに追加する | |
for var in $(cat .env.local | grep -v '^#' | sed 's/=.*//'); do | |
gh secret set $var -b"${!var}" -R $REPO_OWNER/$REPO_NAME | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment