add sample

This commit is contained in:
Aleksandr Razumov 2020-04-26 03:51:07 +03:00
parent 60b57697f8
commit 6eb54d49f7
No known key found for this signature in database
GPG Key ID: 1D14A82D2E311045
3 changed files with 31 additions and 0 deletions

14
.github/workflows/golangci.yml vendored Normal file
View 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"

View File

@ -6,6 +6,9 @@ inputs:
github_token:
description: 'GITHUB_TOKEN'
required: true
flags:
description: 'GolangCI command line flags'
required: false
runs:
using: 'docker'
image: 'Dockerfile'

14
sample/sample.go Normal file
View 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))
}