Skip to content

Commit 6eb54d4

Browse files
committed
add sample
1 parent 60b5769 commit 6eb54d4

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.github/workflows/golangci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: golangci-lint
2+
on: [pull_request]
3+
jobs:
4+
golangci-lint-dockerfile:
5+
name: golangci-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+
flags: "./testdata"

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ inputs:
66
github_token:
77
description: 'GITHUB_TOKEN'
88
required: true
9+
flags:
10+
description: 'GolangCI command line flags'
11+
required: false
912
runs:
1013
using: 'docker'
1114
image: 'Dockerfile'

sample/sample.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
}

0 commit comments

Comments
 (0)