get via vaultwarden

This commit is contained in:
tomas.limpinho
2025-09-07 19:47:42 +01:00
parent f55b0d07b0
commit 6f6cff06e1
2 changed files with 47 additions and 6 deletions

View File

@ -37,12 +37,12 @@ jobs:
with:
path: infra/iac
- name: cloning iac secrets repository
uses: actions/checkout@v4
with:
repository: fenix-gitea-admin/iac-opentofu-private-secrets
token: ${{ secrets.GGITEA_TOKEN }}
path: infra/secrets
#- name: cloning iac secrets repository
# uses: actions/checkout@v4
# with:
# repository: fenix-gitea-admin/iac-opentofu-private-secrets
# token: ${{ secrets.GGITEA_TOKEN }}
# path: infra/secrets
- name: Install cloudflare prerequisites
@ -125,6 +125,28 @@ jobs:
run: |
BW_SESSION=$(bw login)
#!/bin/bash
- name: vaultwarden getsecrets
working-directory: infra
run: |
bw sync
# Ler o arquivo de referência
for secret in $(jq -c '.secrets[]' iac/secrets/vault-secrets-map.json); do
name=$(echo "$secret" | jq -r '.name')
type=$(echo "$secret" | jq -r '.type')
output=$(echo "$secret" | jq -r '.output')
item_id=$(bw get item "$name" | jq -r '.id')
if [ "$type" == "attachment" ]; then
bw get attachment "$output" --itemid "$item_id" --output "$output"
elif [ "$type" == "note" ]; then
bw get item "$name" | jq -r '.notes' > "$output"
fi
done
- name: Set up Python
uses: actions/setup-python@v4
with: