add sample
This commit is contained in:
parent
60b57697f8
commit
6eb54d49f7
14
.github/workflows/golangci.yml
vendored
Normal file
14
.github/workflows/golangci.yml
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
name: golangci-lint
|
||||||
|
on: [pull_request]
|
||||||
|
jobs:
|
||||||
|
golangci-lint-dockerfile:
|
||||||
|
name: golangci-lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
- name: golangci-lint
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.github_token }}
|
||||||
|
flags: "./testdata"
|
@ -6,6 +6,9 @@ inputs:
|
|||||||
github_token:
|
github_token:
|
||||||
description: 'GITHUB_TOKEN'
|
description: 'GITHUB_TOKEN'
|
||||||
required: true
|
required: true
|
||||||
|
flags:
|
||||||
|
description: 'GolangCI command line flags'
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
|
14
sample/sample.go
Normal file
14
sample/sample.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Package sample is used as test input for golangci action.
|
||||||
|
package sample
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/md5"
|
||||||
|
"encoding/hex"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Hash~
|
||||||
|
func Hash(data string) string {
|
||||||
|
h := md5.New()
|
||||||
|
h.Write([]byte(data))
|
||||||
|
return hex.EncodeToString(h.Sum(nil))
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user