diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 50529fd7..e08992c7 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,6 +1,8 @@ name: Plugins - CD run-name: Deploy ${{ inputs.branch }} to ${{ inputs.environment }} by @${{ github.actor }} -permissions: {} +permissions: + contents: read + id-token: write on: workflow_dispatch: diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index f2142305..78fc3619 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -1,5 +1,7 @@ name: Plugins - CI -permissions: {} +permissions: + contents: read + id-token: write on: push: diff --git a/.github/workflows/update-make-docs.yml b/.github/workflows/update-make-docs.yml index a422b6c3..cf61f169 100644 --- a/.github/workflows/update-make-docs.yml +++ b/.github/workflows/update-make-docs.yml @@ -1,5 +1,7 @@ name: Update `make docs` procedure -permissions: {} +permissions: + contents: write + pull-requests: write on: schedule: diff --git a/README.md b/README.md index 97acba4a..6c51efc1 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,4 @@ The first selection is used to filter the events that display on the graph. For The second selection is used to determine where on the graph the event should be displayed. -Typically these will be the same, however there are some cases where you may want them to be different. +Typically, these will be the same, however there are some cases where you may want them to be different. diff --git a/pkg/main.go b/pkg/main.go index 7902239e..5b4948a3 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -3,9 +3,10 @@ package main import ( "os" - "github.com/grafana/github-datasource/pkg/plugin" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/datasource" + + "github.com/grafana/github-datasource/pkg/plugin" ) const dsID = "grafana-github-datasource" diff --git a/pkg/models/packages.go b/pkg/models/packages.go index 616c01b8..57f155c8 100644 --- a/pkg/models/packages.go +++ b/pkg/models/packages.go @@ -39,7 +39,7 @@ var validPackageTypes = []githubv4.PackageType{ githubv4.PackageTypePypi, } -// notSupportedPackageTypes is a list of package types that are not supported by the GitHub graphql API +// notSupportedPackageTypes is a list of package types that are not supported by the GitHub graphql API // They were supported in the past but are not supported anymore and we want to return an error if they are used var notSupportedPackageTypes = []githubv4.PackageType{ githubv4.PackageTypeNpm, @@ -56,4 +56,4 @@ func validatePackageType(packageType githubv4.PackageType) error { return backend.DownstreamError(fmt.Errorf("package type %q is not supported. Valid types are: MAVEN, DOCKER, DEBIAN, PYPI", packageType)) } return backend.DownstreamError(fmt.Errorf("invalid package type %q. Valid types are: MAVEN, DOCKER, DEBIAN, PYPI", packageType)) -} \ No newline at end of file +} diff --git a/pkg/models/packages_test.go b/pkg/models/packages_test.go index c93d2ee9..aeea0d6f 100644 --- a/pkg/models/packages_test.go +++ b/pkg/models/packages_test.go @@ -80,4 +80,4 @@ func Test_validatePackageType(t *testing.T) { } }) } -} \ No newline at end of file +} diff --git a/pkg/plugin/datasource.go b/pkg/plugin/datasource.go index abc5e93a..e4195bb6 100644 --- a/pkg/plugin/datasource.go +++ b/pkg/plugin/datasource.go @@ -3,9 +3,10 @@ package plugin import ( "context" + "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/github-datasource/pkg/dfutil" "github.com/grafana/github-datasource/pkg/models" - "github.com/grafana/grafana-plugin-sdk-go/backend" ) // The Datasource type handles the requests sent to the datasource backend diff --git a/pkg/plugin/datasource_caching.go b/pkg/plugin/datasource_caching.go index d9839d1f..1030eedb 100644 --- a/pkg/plugin/datasource_caching.go +++ b/pkg/plugin/datasource_caching.go @@ -9,10 +9,11 @@ import ( "sync" "time" - "github.com/grafana/github-datasource/pkg/dfutil" - "github.com/grafana/github-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/pkg/errors" + + "github.com/grafana/github-datasource/pkg/dfutil" + "github.com/grafana/github-datasource/pkg/models" ) // CacheDuration is a constant that defines how long to keep cached elements before they are refreshed diff --git a/pkg/plugin/datasource_caching_test.go b/pkg/plugin/datasource_caching_test.go index ef3ce01c..2f5aadd2 100644 --- a/pkg/plugin/datasource_caching_test.go +++ b/pkg/plugin/datasource_caching_test.go @@ -2,11 +2,12 @@ package plugin import ( "encoding/json" + "sync" + "testing" + "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/data" "github.com/stretchr/testify/assert" - "sync" - "testing" ) // mockFramer is a struct implementing the Framer interface that returns predefined frames for testing purposes diff --git a/pkg/plugin/instance.go b/pkg/plugin/instance.go index 87d1a5fa..753defdf 100644 --- a/pkg/plugin/instance.go +++ b/pkg/plugin/instance.go @@ -4,10 +4,11 @@ import ( "context" "fmt" - "github.com/grafana/github-datasource/pkg/github" - "github.com/grafana/github-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt" + + "github.com/grafana/github-datasource/pkg/github" + "github.com/grafana/github-datasource/pkg/models" ) // NewGitHubInstance creates a new GitHubInstance using the settings to determine if things like the Caching Wrapper should be enabled diff --git a/pkg/testutil/client.go b/pkg/testutil/client.go index 2ad9e892..da3325a8 100644 --- a/pkg/testutil/client.go +++ b/pkg/testutil/client.go @@ -6,8 +6,9 @@ import ( "testing" googlegithub "github.com/google/go-github/v53/github" - "github.com/grafana/github-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend" + + "github.com/grafana/github-datasource/pkg/models" ) var ( diff --git a/pkg/testutil/frames.go b/pkg/testutil/frames.go index 58d42bf0..d1d32674 100644 --- a/pkg/testutil/frames.go +++ b/pkg/testutil/frames.go @@ -5,9 +5,10 @@ import ( "path/filepath" "testing" - "github.com/grafana/github-datasource/pkg/dfutil" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/experimental" + + "github.com/grafana/github-datasource/pkg/dfutil" ) // UpdateGoldenFiles defines whether or not to update the files locally after checking the responses for validity