{"id":20675573,"url":"https://github.com/bitwarden/sm-action","last_synced_at":"2025-06-18T05:34:03.800Z","repository":{"id":144927697,"uuid":"616653963","full_name":"bitwarden/sm-action","owner":"bitwarden","description":"Github Action for Secrets Manager","archived":false,"fork":false,"pushed_at":"2025-06-17T00:32:04.000Z","size":21254,"stargazers_count":58,"open_issues_count":24,"forks_count":11,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-06-17T01:31:39.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitwarden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-20T20:13:58.000Z","updated_at":"2025-06-12T08:57:13.000Z","dependencies_parsed_at":"2023-10-01T22:31:40.682Z","dependency_job_id":"b73ddb08-ad19-4f6f-ad75-b66651458d17","html_url":"https://github.com/bitwarden/sm-action","commit_stats":{"total_commits":123,"total_committers":11,"mean_commits":"11.181818181818182","dds":0.2032520325203252,"last_synced_commit":"826af1d0a9da4ac38179cd316ab7b5e4818eaf0b"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/bitwarden/sm-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwarden%2Fsm-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwarden%2Fsm-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwarden%2Fsm-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwarden%2Fsm-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitwarden","download_url":"https://codeload.github.com/bitwarden/sm-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwarden%2Fsm-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260495369,"owners_count":23017886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T21:09:52.681Z","updated_at":"2025-06-18T05:33:58.781Z","avatar_url":"https://github.com/bitwarden.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Use Bitwarden Secrets in GitHub Actions\n\nThe Bitwarden sm-action repository contains the source code for the Secrets Manager GitHub Action.\n\nUse the GitHub action, bitwarden/sm-action, to retrieve secrets from the Bitwarden Secrets Manager for use inside GitHub Actions.\n\nThe bitwarden/sm-action will add retrieved secrets as masked [environment variables](https://docs.github.com/en/actions/learn-github-actions/environment-variables) inside a given GitHub action.\n\nReview GitHub's recommendations for [security hardening GitHub Actions](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions) when using sensitive secrets.\n\n## Usage\n\nTo use the action, add a step to your GitHub workflow using the following syntax:\n\n```\n- name: Step name\n  uses: bitwarden/sm-action@v1\n  with:\n    access_token: ${{ secrets.ACCESS_TOKEN }}\n    secrets: |\n      SECRET_ID \u003e ENVIRONMENT_VARIABLE_NAME\n```\n\n## Parameters\n\n- `access_token`\n\n  The machine account access token for retrieving secrets.\n\n  Use GitHub's [encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) to store and retrieve machine account access tokens securely.\n\n- `secrets`\n\n  One or more secret Ids to retrieve and the corresponding GitHub environment variable name to set.\n\n  GitHub environment variables have stricter naming requirements than Bitwarden secrets.\n\n  So the bitwarden/sm-action requires specifying an environment variable name for each secret retrieved in the following format:\n\n  ```\n  secrets: |\n      SECRET_ID \u003e ENVIRONMENT_VARIABLE_NAME\n  ```\n\n  Example\n\n  ```\n      secrets: |\n          00000000-0000-0000-0000-000000000000 \u003e TEST_EXAMPLE\n  ```\n\n- `cloud_region`\n\n  (Optional) For usage with the cloud-hosted services on either https://vault.bitwarden.com or https://vault.bitwarden.eu\n\n  The default value will use `us`, which is the region for https://vault.bitwarden.com\n\n  To use https://vault.bitwarden.eu, set the value to `eu`\n\n- `base_url`\n\n  (Optional) For self-hosted bitwarden instances provide your https://your.domain.com\n\n  If this optional parameter is provided the parameters identity_url and api_url are not required.\n\n  The GitHub action will use `BASE_URL/identity` and `BASE_URL/api` for the identity and api endpoints.\n\n- `identity_url`\n\n  (Optional) For self-hosted bitwarden instances provide your https://your.domain.com/identity\n\n  Depending on the `cloud_region` setting, the default value will use https://identity.bitwarden.com for `us` (default) or https://identity.bitwarden.eu for `eu`.\n\n- `api_url`\n\n  (Optional) For self-hosted bitwarden instances provide your https://your.domain.com/api\n\n  Depending on the `cloud_region` setting, the default value will use https://api.bitwarden.com for `us` (default) or https://api.bitwarden.eu for `eu`.\n\n## Examples\n\n```\n- name: Get Secrets\n  uses: bitwarden/sm-action@v1\n  with:\n    access_token: ${{ secrets.ACCESS_TOKEN }}\n    secrets: |\n      00000000-0000-0000-0000-000000000000 \u003e TEST_EXAMPLE\n      bdbb16bc-0b9b-472e-99fa-af4101309076 \u003e TEST_EXAMPLE_2\n```\n\nEnvironment variables created:\n\n```\nTEST_EXAMPLE: SECRET_VALUE_FOR_00000000-0000-0000-0000-000000000000\nTEST_EXAMPLE_2: SECRET_VALUE_FOR_bdbb16bc-0b9b-472e-99fa-af4101309076\n```\n\n### Example usage\n\n```\n- name: Get Secrets\n  uses: bitwarden/sm-action@v1\n  with:\n    access_token: ${{ secrets.ACCESS_TOKEN }}\n    cloud_region: eu\n    secrets: |\n      00000000-0000-0000-0000-000000000000 \u003e TEST_EXAMPLE\n- name: Use Secret\n  run: example-command \"$TEST_EXAMPLE\"\n```\n\n# Developing Bitwarden sm-action\n\n## Run Locally\n\nInstall the dependencies\n\n```bash\n$ npm install\n```\n\nRun formatter and lint\n\n```bash\n$ npm run prettier \u0026\u0026 npm run lint\n```\n\nRun the tests :heavy_check_mark:\n\n```bash\n$ npm test\n```\n\n## Prepare Source for Distribution\n\nGitHub recommends using a tool called [@vercel/ncc](https://github.com/vercel/ncc) to compile code and modules into one file used for distribution.\n\n- Package the TypeScript for distribution\n\n```bash\n$ npm run bundle\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwarden%2Fsm-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitwarden%2Fsm-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwarden%2Fsm-action/lists"}