diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a03f7b5..4e49869 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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' diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-release.yml similarity index 63% rename from .github/workflows/conventional-commits.yml rename to .github/workflows/conventional-release.yml index f24fcdc..1953e09 100644 --- a/.github/workflows/conventional-commits.yml +++ b/.github/workflows/conventional-release.yml @@ -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" diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index fec4f31..c573ec8 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -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" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1aedd09..e609fe2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,6 +7,8 @@ on: jobs: goreleaser: runs-on: 'ubuntu-latest' + permissions: + contents: "write" steps: - uses: 'actions/checkout@v4' - uses: 'actions/setup-go@v5' diff --git a/fields/main.go b/fields/main.go index 1a54f28..ea57d21 100644 --- a/fields/main.go +++ b/fields/main.go @@ -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)