Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bufbuild/buf-setup-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.17.0
Choose a base ref
...
head repository: bufbuild/buf-setup-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.18.0
Choose a head ref
  • 3 commits
  • 5 files changed
  • 3 contributors

Commits on Apr 11, 2023

  1. Allow configuring the buf remote (#121)

    Add an input to the setup action that can control which Buf Schema
    Registry to login to, which will be useful for users who have a private
    BSR instance. I used `domain` as this is what we refer to in the cli
    help:
    ```
    $ buf registry login --help
    Log in to the Buf Schema Registry
    
    This prompts for your BSR username and a BSR token and updates your .netrc file with these credentials.
    The <domain> argument will default to buf.build if not specified.
    
    Usage:
      buf registry login <domain> [flags]
    ```
    rhbuf authored Apr 11, 2023
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e349d57 View commit details

Commits on Apr 20, 2023

  1. Add documentation for github token scopes (#122)

    The README did not make it clear what scopes were needed by the github
    token that was provided to the action. I have added a section explaining
    this and also an example of using the `GITHUB_TOKEN` secret.
    
    Fixes #114
    rhbuf authored Apr 20, 2023
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bde3eb2 View commit details

Commits on May 5, 2023

  1. Release v1.18.0 (#129)

    Release prepared for 1.18.0
    
    Co-authored-by: joshcarp <[email protected]>
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    144a2f3 View commit details
Showing with 42 additions and 18 deletions.
  1. +31 −12 README.md
  2. +5 −1 action.yml
  3. +1 −1 dist/main.js
  4. +3 −3 dist/main.js.map
  5. +2 −1 src/run.ts
43 changes: 31 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ steps:
# Run `git checkout`
- uses: actions/checkout@v2
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1.17.0
- uses: bufbuild/buf-setup-action@v1.18.0
# Ensure that `buf` is installed
- run: buf --version
```
@@ -32,10 +32,11 @@ You can configure `buf-setup-action` with these parameters:

| Parameter | Description | Default |
|:---------------|:---------------------------------------------------|:-------------------|
| `version` | The version of the [`buf` CLI][buf-cli] to install | [`v1.17.0`][version] |
| `version` | The version of the [`buf` CLI][buf-cli] to install | [`v1.18.0`][version] |
| `github_token` | The GitHub token to use when making API requests | |
| `buf_user` | The username to use for logging into Buf Schema registry. | |
| `buf_api_token` | The API token to use for logging into Buf Schema registry. | |
| `buf_domain` | The domain of the Buf Schema Registry to login to. | buf.build |

> These parameters are derived from [`action.yml`](./action.yml). <br>
#### Version
@@ -46,7 +47,7 @@ If `version` is unspecified, the latest version of `buf` is installed:
steps:
- uses: actions/checkout@v2
# Installs latest
- uses: bufbuild/buf-setup-action@v1.17.0
- uses: bufbuild/buf-setup-action@v1.18.0
- run: buf --version
```

@@ -55,11 +56,11 @@ Use the `version` parameter to pin to a specific version:
```yaml
steps:
- uses: actions/checkout@v2
# Installs version 1.17.0
- uses: bufbuild/buf-setup-action@v1.17.0
# Installs version 1.18.0
- uses: bufbuild/buf-setup-action@v1.18.0
with:
version: 1.17.0
# Should output 1.17.0
version: 1.18.0
# Should output 1.18.0
- run: buf --version
```

@@ -69,7 +70,7 @@ recommended:
```yaml
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1.17.0
- uses: bufbuild/buf-setup-action@v1.18.0
with:
version: latest
- run: buf --version
@@ -82,18 +83,30 @@ This may prevent rate limit issues when running on GitHub hosted runners:

```yaml
steps:
- uses: bufbuild/buf-setup-action@v1.17.0
- uses: bufbuild/buf-setup-action@v1.18.0
with:
github_token: ${{ github.token }}
```

The token will need the `contents:read` permission to be able to read the latest release and tag of buf. This permission
is granted [by default](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)
to 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,
you must still pass the token to the action:

```yaml
steps:
- uses: bufbuild/buf-setup-action@v1.18.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```

#### Buf username and Buf API token

If 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`.

```yaml
steps:
- uses: bufbuild/buf-setup-action@v1.17.0
- uses: bufbuild/buf-setup-action@v1.18.0
with:
buf_user: ${{ secrets.buf_user }}
buf_api_token: ${{ secrets.buf_api_token }}
@@ -117,6 +130,12 @@ Note that this only authenticate you with the `buf` cli. You cannot access your
packages in BSR. If you need to access your private remote packages, supply the username and Buf
API Token [as parameters](#buf-username-and-buf-api-token).

#### Buf domain

If you are working with a private BSR then you can set the `buf_domain` input to the domain of
your 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`.


#### Installing `protoc`

In most cases, you _don't_ need to install [`protoc`][protoc] for Buf's GitHub Actions, but some
@@ -144,7 +163,7 @@ steps:
# Run `git checkout`
- uses: actions/checkout@v2
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1.17.0
- uses: bufbuild/buf-setup-action@v1.18.0
# Install `protoc`
- uses: arduino/setup-protoc@v1
```
@@ -160,4 +179,4 @@ steps:
[compiler]: https://docs.buf.build/build/internal-compiler
[protoc]: https://github.com/protocolbuffers/protobuf#protocol-compiler-installation
[setup-protoc]: https://github.com/marketplace/actions/setup-protoc
[version]: https://github.com/bufbuild/buf/releases/tag/v1.17.0
[version]: https://github.com/bufbuild/buf/releases/tag/v1.18.0
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ inputs:
version:
description: The version of buf to set up.
required: false
default: '1.17.0'
default: '1.18.0'
github_token:
description: The GitHub token to use when making API requests.
required: false
@@ -18,6 +18,10 @@ inputs:
buf_api_token:
description: The API token to use for logging into Buf Schema registry.
required: false
buf_domain:
description: The domain of the Buf Schema Registry to login to.
required: false
default: 'buf.build'
runs:
using: "node16"
main: "./dist/main.js"
2 changes: 1 addition & 1 deletion dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading