{"id":29343617,"url":"https://github.com/bufbuild/buf-setup-action","last_synced_at":"2025-07-08T12:11:08.803Z","repository":{"id":38890987,"uuid":"348845583","full_name":"bufbuild/buf-setup-action","owner":"bufbuild","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-23T18:06:22.000Z","size":794,"stargazers_count":38,"open_issues_count":7,"forks_count":28,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-07-01T10:52:02.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bufbuild.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-17T20:38:14.000Z","updated_at":"2025-04-24T16:02:28.000Z","dependencies_parsed_at":"2023-10-05T16:31:02.562Z","dependency_job_id":"f43168d1-3bb9-4f4b-bcb8-fef554059a74","html_url":"https://github.com/bufbuild/buf-setup-action","commit_stats":{"total_commits":143,"total_committers":27,"mean_commits":5.296296296296297,"dds":0.6013986013986015,"last_synced_commit":"1115d0acd3d2a120b30023fac52abc46807c8fd6"},"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"purl":"pkg:github/bufbuild/buf-setup-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufbuild%2Fbuf-setup-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufbuild%2Fbuf-setup-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufbuild%2Fbuf-setup-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufbuild%2Fbuf-setup-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bufbuild","download_url":"https://codeload.github.com/bufbuild/buf-setup-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufbuild%2Fbuf-setup-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264267170,"owners_count":23581933,"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":"2025-07-08T12:11:07.945Z","updated_at":"2025-07-08T12:11:08.795Z","avatar_url":"https://github.com/bufbuild.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `buf-setup-action`\n\n\u003e [!NOTE]\n\u003e This action has been deprecated in favor of the [`buf-action`][buf-action] which combines the\n\u003e functionality of `buf-setup-action` with the ability to run Buf commands in the same step. Please\n\u003e see the [migration guide][buf-action-migration] for more information.\n\nThis [Action] installs the [`buf`][buf-cli] CLI in your GitHub Actions pipelines so that it can be\nused by other Buf Actions:\n\n* [`buf-breaking-action`][buf-breaking]\n* [`buf-lint-action`][buf-lint]\n* [`buf-push-action`][buf-push]\n\nAfter `buf-setup-action` is run, the `buf` command is available to other Actions in the pipeline's\n`PATH`. You can also use the `buf` command directly inside of workflow steps.\n\n## Usage\n\nHere's an example usage of `buf-setup-action`:\n\n```yaml\nsteps:\n  # Run `git checkout`\n  - uses: actions/checkout@v2\n  # Install the `buf` CLI\n  - uses: bufbuild/buf-setup-action@v1.50.0\n  # Ensure that `buf` is installed\n  - run: buf --version\n```\n\n## Configuration\n\n### Input\n\nYou can configure `buf-setup-action` with these parameters:\n\n| Parameter      | Description                                        | Default            |\n|:---------------|:---------------------------------------------------|:-------------------|\n| `version`      | The version of the [`buf` CLI][buf-cli] to install | [`v1.50.0`][version] |\n| `github_token` | The GitHub token to use when making API requests   |                    |\n| `buf_user`     | The username to use for logging into Buf Schema registry.                                               |                    |\n| `buf_api_token` | The API token to use for logging into Buf Schema registry.                                                                                                            |                    |\n| `buf_domain`    | The domain of the Buf Schema Registry to login to.     | buf.build |\n\n\u003e These parameters are derived from [`action.yml`](./action.yml). \u003cbr\u003e\n#### Version\n\nIf `version` is unspecified, the latest version of `buf` is installed:\n\n```yaml\nsteps:\n  - uses: actions/checkout@v2\n  # Installs latest\n  - uses: bufbuild/buf-setup-action@v1.50.0\n  - run: buf --version\n```\n\nUse the `version` parameter to pin to a specific version:\n\n```yaml\nsteps:\n  - uses: actions/checkout@v2\n  # Installs version 1.50.0\n  - uses: bufbuild/buf-setup-action@v1.50.0\n    with:\n      version: 1.50.0\n  # Should output 1.50.0\n  - run: buf --version\n```\n\nTo resolve the latest release from GitHub, you can specify `latest`, but this is **not**\nrecommended:\n\n```yaml\nsteps:\n  - uses: actions/checkout@v2\n  - uses: bufbuild/buf-setup-action@v1.50.0\n    with:\n      version: latest\n  - run: buf --version\n```\n\n#### GitHub token\n\nOptionally, you can supply a `github_token` input so that any GitHub API requests are authenticated.\nThis may prevent rate limit issues when running on GitHub hosted runners:\n\n```yaml\nsteps:\n  - uses: bufbuild/buf-setup-action@v1.50.0\n    with:\n      github_token: ${{ github.token }}\n```\n\nThe token will need the `contents:read` permission to be able to read the latest release and tag of buf. This permission\nis granted [by default](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)\nto the `GITHUB_TOKEN` that is created for every workflow run of a Github Action, so it is not necessary to explicitly specify the permission. However,\nyou must still pass the token to the action:\n\n```yaml\nsteps:\n  - uses: bufbuild/buf-setup-action@v1.50.0\n    with:\n      github_token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n#### Buf username and Buf API token\n\nIf you are using Private [Remote Packages](https://docs.buf.build/bsr/remote-packages/overview) you may need to authenticate the entire system to successfully communicate with the [Buf Schema Registry][bsr]. To achieve this, supply both `buf_user` and `buf_api_token`. This will add your auth credentials to the `.netrc` and allow you to access the BSR from anything in your `PATH`. \n\n```yaml\nsteps:\n  - uses: bufbuild/buf-setup-action@v1.50.0\n    with:\n      buf_user: ${{ secrets.buf_user }}\n      buf_api_token: ${{ secrets.buf_api_token }}\n```\n\n### Other Configurations\n\n#### Buf token\n\nWhen calling the `buf` command directly from a workflow step, you may need to authenticate with the\nBSR. You can authenticate by setting the [`BUF_TOKEN`][buf-token]\nenvironment variable. If you have a GitHub secret called `BUF_TOKEN`, for example, you can set the\n`BUF_TOKEN`  environment variable like this:\n\n```yaml\nenv:\n  BUF_TOKEN: ${{ secrets.BUF_TOKEN }}\n```\n\nNote that this only authenticate you with the `buf` cli. You cannot access your private remote \npackages in BSR. If you need to access your private remote packages, supply the username and Buf\nAPI Token [as parameters](#buf-username-and-buf-api-token). \n\n#### Buf domain\n\nIf you are working with a private BSR then you can set the `buf_domain` input to the domain of\nyour instance. Please ensure that you are using a token created on your instance (e.g. `https://buf.example.com/settings/user`) and not from the public BSR at `https://buf.build`.\n\n\n#### Installing `protoc`\n\nIn most cases, you _don't_ need to install [`protoc`][protoc] for Buf's GitHub Actions, but some\n`protoc` plugins are built into the compiler itself. If you need to execute one of these plugins,\nyou do need to install `protoc` alongside `buf`:\n\n* `protoc-gen-cpp` (C++)\n* `protoc-gen-csharp` (C#)\n* `protoc-gen-java` (Java)\n* `protoc-gen-js` (JavaScript)\n* `protoc-gen-objc` (Objective-C)\n* `protoc-gen-php` (PHP)\n* `protoc-gen-python` (Python)\n* `protoc-gen-ruby` (Ruby)\n* `protoc-gen-kotlin` (Kotlin)\n\nIn these cases, `buf` executes `protoc` as a plugin but continues to use its own [internal\ncompiler][compiler].\n\nThe `buf-setup-action` doesn't install `protoc` for you, but there are other options you can\nuse, such as [`setup-protoc`][setup-protoc]. To configure it alongside `buf`:\n\n```yaml\nsteps:\n  # Run `git checkout`\n  - uses: actions/checkout@v2\n  # Install the `buf` CLI\n  - uses: bufbuild/buf-setup-action@v1.50.0\n  # Install `protoc`\n  - uses: arduino/setup-protoc@v1\n```\n\n[action]: https://docs.github.com/actions\n[buf-action]: https://github.com/bufbuild/buf-action\n[buf-action-migration]: https://github.com/bufbuild/buf-action/blob/main/MIGRATION.md#buf-setup-action\n[breaking]: https://docs.buf.build/breaking\n[bsr]: https://docs.buf.build/bsr\n[buf-breaking]: https://github.com/marketplace/actions/buf-breaking\n[buf-cli]: https://github.com/bufbuild/buf\n[buf-lint]: https://github.com/marketplace/actions/buf-lint\n[buf-push]: https://github.com/marketplace/actions/buf-push\n[buf-token]: https://docs.buf.build/bsr/authentication#buf_token\n[compiler]: https://docs.buf.build/build/internal-compiler\n[protoc]: https://github.com/protocolbuffers/protobuf#protocol-compiler-installation\n[setup-protoc]: https://github.com/marketplace/actions/setup-protoc\n[version]: https://github.com/bufbuild/buf/releases/tag/v1.50.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufbuild%2Fbuf-setup-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbufbuild%2Fbuf-setup-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufbuild%2Fbuf-setup-action/lists"}