-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: leverage vault secrets in helm release
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Secure Test Vault Secrets Retrieval | ||
|
||
on: | ||
pull_request: | ||
|
||
# These permissions are needed to assume roles from Github's OIDC. | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
test-get-secrets: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- id: get-secrets | ||
uses: grafana/shared-workflows/actions/get-vault-secrets@main | ||
with: | ||
repo_secrets: | | ||
APP_ID=secret/ci/repo/grafana/helm-charts/github-app:app-id | ||
APP_PRIVATE_KEY=secret/ci/repo/grafana/helm-charts/github-app:private-key | ||
- name: Check Secrets (Safely) | ||
run: | | ||
if [ -n "$APP_ID" ]; then | ||
echo "app id is set and not empty" | ||
else | ||
echo "app id is not set or is empty" | ||
exit 1 | ||
fi | ||
if [ -n "$APP_PRIVATE_KEY" ]; then | ||
echo "private key is set and not empty" | ||
else | ||
echo "private key is not set or is empty" | ||
exit 1 | ||
fi | ||
echo "Secrets retrieved successfully" |