File tree Expand file tree Collapse file tree 7 files changed +58
-2
lines changed Expand file tree Collapse file tree 7 files changed +58
-2
lines changed Original file line number Diff line number Diff line change 1
- name : Docker Image CI
1
+ name : docker image
2
2
3
3
on : [push]
4
4
Original file line number Diff line number Diff line change
1
+ name : golangci
2
+ on : [pull_request]
3
+ jobs :
4
+ golangci-lint-dockerfile :
5
+ name : lint
6
+ runs-on : ubuntu-latest
7
+ steps :
8
+ - name : Check out code into the Go module directory
9
+ uses : actions/checkout@v1
10
+ - name : golangci-lint
11
+ uses : ./
12
+ with :
13
+ github_token : ${{ secrets.github_token }}
14
+ directory : sample
15
+ format : colored-line-number
16
+ flags : --issues-exit-code 0
Original file line number Diff line number Diff line change 1
1
FROM golangci/golangci-lint:v1.25
2
+
3
+ COPY entrypoint.sh /entrypoint.sh
4
+
5
+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1
1
# golangci-lint-action
2
2
3
3
Work in progress
4
+
5
+ Based on [ reviewdog action] ( https://github.com/reviewdog/action-golangci-lint ) .
Original file line number Diff line number Diff line change 6
6
github_token :
7
7
description : ' GITHUB_TOKEN'
8
8
required : true
9
+ flags :
10
+ description : ' GolangCI command line flags'
11
+ required : false
12
+ directory :
13
+ description : ' Working directory'
14
+ required : false
15
+ default : ' '
16
+ format :
17
+ description : ' Output format of issues'
18
+ default : ' github-actions'
19
+ required : false
20
+
21
+
9
22
runs :
10
23
using : ' docker'
11
24
image : ' Dockerfile'
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- golangci-lint run --out-format github-actions
3
+ echo ' golangci-lint-action: start'
4
+ echo " flags: ${INPUT_FLAGS} "
5
+ echo " format: ${INPUT_FORMAT} "
6
+
7
+ cd " ${GITHUB_WORKSPACE} /${INPUT_DIRECTORY} " || exit 1
8
+
9
+ # shellcheck disable=SC2086
10
+ golangci-lint run --out-format ${INPUT_FORMAT} ${INPUT_FLAGS}
Original file line number Diff line number Diff line change
1
+ // Package sample is used as test input for golangci action.
2
+ package sample
3
+
4
+ import (
5
+ "crypto/md5"
6
+ "encoding/hex"
7
+ )
8
+
9
+ // Hash~
10
+ func Hash (data string ) string {
11
+ h := md5 .New ()
12
+ h .Write ([]byte (data ))
13
+ return hex .EncodeToString (h .Sum (nil ))
14
+ }
You can’t perform that action at this time.
0 commit comments