Automatically update the controller version (#57)
Create a new GitHub Actions workflow to submit a pull request for new controller versions.
This commit is contained in:
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@@ -42,9 +42,9 @@ jobs:
|
|||||||
- uses: "actions/setup-go@v2"
|
- uses: "actions/setup-go@v2"
|
||||||
with:
|
with:
|
||||||
go-version: "${{ env.GO_VERSION }}"
|
go-version: "${{ env.GO_VERSION }}"
|
||||||
- run: "go get golang.org/x/tools/cmd/stringer"
|
- run: "go install golang.org/x/tools/cmd/stringer"
|
||||||
|
|
||||||
- run: "go generate ./..."
|
- run: "go generate unifi/device.go"
|
||||||
- run: "git diff --compact-summary --exit-code"
|
- run: "git diff --compact-summary --exit-code"
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
|
|||||||
31
.github/workflows/generate.yaml
vendored
Normal file
31
.github/workflows/generate.yaml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
env:
|
||||||
|
GO_VERSION: "^1.16"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
fields:
|
||||||
|
runs-on: "ubuntu-latest"
|
||||||
|
steps:
|
||||||
|
- uses: "actions/setup-go@v2"
|
||||||
|
with:
|
||||||
|
go-version: "${{ env.GO_VERSION }}"
|
||||||
|
|
||||||
|
- uses: "actions/checkout@v2"
|
||||||
|
- uses: "actions/cache@v2"
|
||||||
|
with:
|
||||||
|
path: "~/go/pkg/mod"
|
||||||
|
key: "${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}"
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gomod-
|
||||||
|
|
||||||
|
# TODO: Automatically merge the PR if tests pass.
|
||||||
|
- run: "go generate unifi/fields.go"
|
||||||
|
- uses: "peter-evans/create-pull-request@v3"
|
||||||
|
with:
|
||||||
|
delete-branch: true
|
||||||
|
title: "Update to latest controller version"
|
||||||
Reference in New Issue
Block a user