Skip to content

Instantly share code, notes, and snippets.

@ybiquitous
Created February 19, 2025 00:56
Show Gist options
  • Save ybiquitous/a0617d4a0c248cec05d81fd6c2634696 to your computer and use it in GitHub Desktop.
Save ybiquitous/a0617d4a0c248cec05d81fd6c2634696 to your computer and use it in GitHub Desktop.
Set GitHub secrets to multiple repositories vis GitHub CLI
YOUR_SECRET=<value>
#!/usr/bin/env bash
set -eux -o pipefail
# See https://cli.github.com/manual/gh_secret
# Insert your repositories
repos=(
...
)
for repo in ${repos}; do
gh secret -R "${repo}" set -f .env
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment