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:
|
on:
|
||||||
pull_request: {}
|
pull_request: {}
|
||||||
push:
|
push:
|
||||||
@@ -7,6 +8,9 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: "read"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
name: "conventional-commits"
|
name: "Conventional Release Labels"
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types:
|
types:
|
||||||
@@ -7,6 +7,9 @@ on:
|
|||||||
- "edited"
|
- "edited"
|
||||||
jobs:
|
jobs:
|
||||||
label:
|
label:
|
||||||
|
permissions:
|
||||||
|
pull-requests: "write"
|
||||||
|
contents: "read"
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: "bcoe/conventional-release-labels@v1"
|
- 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:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * *"
|
- cron: "0 0 * * *"
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
pull_request: {}
|
pull_request: {}
|
||||||
|
|
||||||
permissions:
|
permissions: "write-all"
|
||||||
contents: "write"
|
|
||||||
pull-requests: "write"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fields:
|
fields:
|
||||||
@@ -23,10 +22,10 @@ jobs:
|
|||||||
|
|
||||||
- name: "Read Unifi version marker"
|
- name: "Read Unifi version marker"
|
||||||
id: "unifi_version"
|
id: "unifi_version"
|
||||||
uses: 'juliangruber/read-file-action@v1'
|
uses: "juliangruber/read-file-action@v1"
|
||||||
with:
|
with:
|
||||||
path: "./unifi-version"
|
path: "./.unifi-version"
|
||||||
trim: 'true'
|
trim: "true"
|
||||||
|
|
||||||
# TODO: Automatically merge the PR if tests pass.
|
# TODO: Automatically merge the PR if tests pass.
|
||||||
- uses: "peter-evans/create-pull-request@v7"
|
- 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:
|
jobs:
|
||||||
goreleaser:
|
goreleaser:
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
|
permissions:
|
||||||
|
contents: "write"
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v4'
|
- uses: 'actions/checkout@v4'
|
||||||
- uses: 'actions/setup-go@v5'
|
- uses: 'actions/setup-go@v5'
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ func main() {
|
|||||||
log.Infoln("Downloading UniFi Controller field definitions...")
|
log.Infoln("Downloading UniFi Controller field definitions...")
|
||||||
err = DownloadAndExtract(*unifiVersion.DownloadUrl, fieldsDir)
|
err = DownloadAndExtract(*unifiVersion.DownloadUrl, fieldsDir)
|
||||||
if err != nil {
|
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)
|
panic(err)
|
||||||
}
|
}
|
||||||
log.Infof("Downloaded UniFi Controller field definitions in %s", fieldsDir)
|
log.Infof("Downloaded UniFi Controller field definitions in %s", fieldsDir)
|
||||||
|
|||||||
Reference in New Issue
Block a user