-
Notifications
You must be signed in to change notification settings - Fork 18
47 lines (47 loc) · 1.52 KB
/
lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
name: "Lint"
on:
push:
branches:
- "!dependabot/*"
- "*"
pull_request:
branches:
- "*"
jobs:
lint:
name: "Lint & Publish Draft/Branch"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/yaml-lint@main"
- uses: "bufbuild/[email protected]"
with:
version: "1.30.0"
- uses: "bufbuild/buf-lint-action@v1"
- uses: "bufbuild/buf-breaking-action@v1"
if: "github.event_name == 'pull_request'"
env:
BUF_INPUT_HTTPS_USERNAME: "${{ github.actor }}"
BUF_INPUT_HTTPS_PASSWORD: "${{ github.token }}"
with:
against: "https://github.com/authzed/api.git#branch=main"
buf_token: "${{ secrets.BUF_REGISTRY_TOKEN }}"
- name: "Push to BSR"
if: "github.event_name == 'push' && github.ref == 'refs/heads/main'"
shell: "bash"
env:
BUF_TOKEN: "${{ secrets.BUF_REGISTRY_TOKEN }}"
run: "buf push --draft ${{ github.sha }}"
- name: "Push to BSR a Draft"
if: "github.event_name == 'push' && github.ref == 'refs/heads/main'"
shell: "bash"
env:
BUF_TOKEN: "${{ secrets.BUF_REGISTRY_TOKEN }}"
run: "buf push --draft ${{ github.sha }}"
- name: "Push to BSR a Branch"
if: "github.event_name == 'push' && github.ref != 'refs/heads/main'"
shell: "bash"
env:
BUF_TOKEN: "${{ secrets.BUF_REGISTRY_TOKEN }}"
run: "buf push --branch ${{ github.sha }}"