Skip to content

Commit

Permalink
Update buf to version with protovalidate linter (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkwarren authored Nov 3, 2023
1 parent 8b3f3b5 commit d8fae8f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 21 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,34 @@ on:
push:
jobs:
lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/[email protected]
- uses: actions/checkout@v4
- name: install
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-registry-proto-ci-${{ hashFiles('**/Makefile') }}
restore-keys: ${{ runner.os }}-registry-proto-ci-
- name: Lint
run: |
make lint
push:
environment: production
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- lint
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/[email protected]
- uses: actions/checkout@v4
- name: Install buf cli
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
- uses: bufbuild/buf-push-action@v1
with:
buf_token: ${{ secrets.BUF_TOKEN }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BIN := .tmp/bin
export PATH := $(BIN):$(PATH)
export GOBIN := $(abspath $(BIN))

BUF_VERSION := v1.27.1
BUF_VERSION := 21ba19590be4afe6fa3af0406e138c4fdc36fedf
COPYRIGHT_YEARS := 2023

.PHONY: help
Expand Down
8 changes: 4 additions & 4 deletions buf/registry/owner/v1beta1/organization.proto
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ message OrganizationRef {
// The id of the Organization.
string id = 1 [(buf.validate.field).string.uuid = true];
// The name of the Organization.
string name = 2 [
(buf.validate.field).required = true,
(buf.validate.field).string.max_len = 255
];
string name = 2 [(buf.validate.field).string = {
min_len: 1;
max_len: 255;
}];
}
}
8 changes: 4 additions & 4 deletions buf/registry/owner/v1beta1/owner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ message OwnerRef {
// The id of the User or Organization.
string id = 1 [(buf.validate.field).string.uuid = true];
// The name of the User or Organization.
string name = 2 [
(buf.validate.field).required = true,
(buf.validate.field).string.max_len = 255
];
string name = 2 [(buf.validate.field).string = {
min_len: 1;
max_len: 255;
}];
}
}
8 changes: 4 additions & 4 deletions buf/registry/owner/v1beta1/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ message UserRef {
// The id of the User.
string id = 1 [(buf.validate.field).string.uuid = true];
// The name of the User.
string name = 2 [
(buf.validate.field).required = true,
(buf.validate.field).string.max_len = 255
];
string name = 2 [(buf.validate.field).string = {
min_len: 1;
max_len: 255;
}];
}
}

0 comments on commit d8fae8f

Please sign in to comment.