Fetch credentials from a Bitwarden vault in CI using a reusable pre-shared key (PSK). Each workflow run performs a fresh Noise handshake — no cached sessions required.
- A trusted machine runs
aac listen --reusable-pskwith Bitwarden unlocked - The listener prints a 129-character PSK token (once)
- GitHub Actions uses that token to connect, authenticate, and fetch credentials on every run
On a trusted machine with the bw CLI unlocked:
aac listen --reusable-pskCopy the printed PSK token.
| Secret | Value |
|---|---|
AAC_TOKEN |
The 129-char PSK token from step 1 |
Copy reusable-psk-credential.yml into your repo's .github/workflows/ directory and adjust the domain and credential usage to fit your needs.
Inject credentials into a command — use aac run instead of aac connect:
- name: Run with credentials
run: |
aac run \
--domain "registry.example.com" \
--ephemeral-connection \
--env DOCKER_USER=username \
--env DOCKER_PASS=password \
-- sh -c 'echo "$DOCKER_PASS" | docker login registry.example.com -u "$DOCKER_USER" --password-stdin'Fetch by vault item ID — replace --domain with --id:
- name: Fetch by ID
run: |
aac connect \
--id "12345678-1234-1234-1234-123456789abc" \
--ephemeral-connection \
--output json