Example of Bitwarden CLI use in a github action?

Anyone know of any examples of using Bitwarden CLI in a github action? I found this git action repo but there are no examples and I’m so far unsuccessful in getting it to work. I would like to store .env settings files in a Bitwarden note then deploy the .env at build time within github action. For software developers this seems like a natural use case.

I was able to get this working:

name: Pull Bitwarden secrets
on:
push:
branches:
- master
jobs:
publish:
name: Install and publish
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 14.x
- uses: pastisprologue/[email protected]
with:
bitwarden-username: ${{ secrets.BW_USERNAME }}
bitwarden-password: ${{ secrets.BW_PASSWORD }}
- run: sudo apt install jq
- run: bw get item env1 | jq ‘.notes’

1 Like