Skip to content

Commit

Permalink
Add github actions (#8)
Browse files Browse the repository at this point in the history
* Add github actions

* fix api key for later use
  • Loading branch information
pvizeli authored Oct 12, 2020
1 parent 8fd7339 commit c5b27ae
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: golangci-lint
on:
push:
branches:
- master
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.31

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: -D errcheck

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
13 changes: 13 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: hadolint
on:
push:
branches:
- master
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: brpaz/[email protected]
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

var cli *client.Client
var apiKey string
var apiKey string //nolint
var hassioNetwork *net.IPNet
var indexTemplate *template.Template
var wwwRoot string
Expand All @@ -30,7 +30,7 @@ func main() {
apiKey = os.Getenv("SUPERVISOR_TOKEN")
_, hassioNetwork, _ = net.ParseCIDR("172.30.32.0/23")
development = (os.Getenv("DEVELOPMENT") == "True")
httpClient = http.Client{Timeout: 3 * time.Second} //nolint
httpClient = http.Client{Timeout: 3 * time.Second}

if development {
wwwRoot = "./rootfs/usr/share/www/"
Expand Down

0 comments on commit c5b27ae

Please sign in to comment.