ci: apply permissions and linting
This commit is contained in:
committed by
Mateusz Filipowicz
parent
2cfed99cf5
commit
399c5cde86
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@@ -1,4 +1,5 @@
|
||||
---
|
||||
name: "Continuous Integration"
|
||||
on:
|
||||
pull_request: {}
|
||||
push:
|
||||
@@ -7,6 +8,9 @@ on:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
permissions:
|
||||
contents: "read"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: 'ubuntu-latest'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: "conventional-commits"
|
||||
name: "Conventional Release Labels"
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
@@ -7,6 +7,9 @@ on:
|
||||
- "edited"
|
||||
jobs:
|
||||
label:
|
||||
permissions:
|
||||
pull-requests: "write"
|
||||
contents: "read"
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "bcoe/conventional-release-labels@v1"
|
||||
11
.github/workflows/generate.yaml
vendored
11
.github/workflows/generate.yaml
vendored
@@ -1,13 +1,12 @@
|
||||
---
|
||||
name: "Generate Unifi structures"
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch: {}
|
||||
pull_request: {}
|
||||
|
||||
permissions:
|
||||
contents: "write"
|
||||
pull-requests: "write"
|
||||
permissions: "write-all"
|
||||
|
||||
jobs:
|
||||
fields:
|
||||
@@ -23,10 +22,10 @@ jobs:
|
||||
|
||||
- name: "Read Unifi version marker"
|
||||
id: "unifi_version"
|
||||
uses: 'juliangruber/read-file-action@v1'
|
||||
uses: "juliangruber/read-file-action@v1"
|
||||
with:
|
||||
path: "./unifi-version"
|
||||
trim: 'true'
|
||||
path: "./.unifi-version"
|
||||
trim: "true"
|
||||
|
||||
# TODO: Automatically merge the PR if tests pass.
|
||||
- uses: "peter-evans/create-pull-request@v7"
|
||||
|
||||
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -7,6 +7,8 @@ on:
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: 'ubuntu-latest'
|
||||
permissions:
|
||||
contents: "write"
|
||||
steps:
|
||||
- uses: 'actions/checkout@v4'
|
||||
- uses: 'actions/setup-go@v5'
|
||||
|
||||
@@ -64,7 +64,7 @@ func main() {
|
||||
log.Infoln("Downloading UniFi Controller field definitions...")
|
||||
err = DownloadAndExtract(*unifiVersion.DownloadUrl, fieldsDir)
|
||||
if err != nil {
|
||||
log.Fatalln("unable to download and extract UniFi Controller field definitions")
|
||||
log.Fatalf("unable to download and extract UniFi Controller field definitions: %s", err)
|
||||
panic(err)
|
||||
}
|
||||
log.Infof("Downloaded UniFi Controller field definitions in %s", fieldsDir)
|
||||
|
||||
Reference in New Issue
Block a user