bitwarden/sm-action

variable name as id

CanRau opened this issue · 1 comments

CanRau commented

Hey, just finally started integrating Secrets Manager into my workflow and am in general pretty happy to finally get more structure and clarity.

I was wondering if it'd be possible to define the secrets using their name instead of id like so

- name: Step name
  uses: bitwarden/sm-action@v1
  with:
    access_token: ${{ secrets.ACCESS_TOKEN }}
    secrets: |
      MY_SECRET > ENVIRONMENT_VARIABLE_NAME

instead of shtg like this

- name: Step name
  uses: bitwarden/sm-action@v1
  with:
    access_token: ${{ secrets.ACCESS_TOKEN }}
    secrets: |
      b1885261-f75e-43e6-9353-7bc6cffff554 > ENVIRONMENT_VARIABLE_NAME

if this would be possible it could bring a couple of benefits, though I'm certainly interested in possible downsides/issues

  1. No confusion as to if I've mapped the right id to ENVIRONMENT_VARIABLE_NAME
  2. No need to get the id from the CLI (couldn't find another way currently to get the id)
  3. I could have different projects for staging, production etc each with the same set of equally named secrets, so I'd only have to provide a different access_token to the action instead of defining a separate step and having to map all secrets again because they have different IDs.

Or maybe I'm using it currently wrong and there's other ways of achieving the same?

CanRau commented

Getting closer:

The team is currently evaluating the retrieval of secrets by name for consideration in a future release.
As an initial improvement, the process of retrieving the UUID has been streamlined and is now conveniently displayed below every secret.

From https://twitter.com/Bitwarden/status/1708894990766895280?t=8IAjXjcBB8uNHGOcSMvp9w&s=19