This is an automated email from the ASF dual-hosted git repository. kezhenxu94 pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git
commit 97ac7986457a0850523e673b17e705dd3814c240 Author: kezhenxu94 <[email protected]> AuthorDate: Tue Dec 1 23:23:23 2020 +0800 feature: wrap the tool into a GitHub Action --- Dockerfile | 31 +++++++++++++++++++++++++++++++ Makefile | 2 +- action.yml | 21 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1205638 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:1.14.3-alpine AS build + +WORKDIR /src + +COPY . . + +RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /bin/license-checker + +FROM alpine:3 AS bin + +COPY --from=build /bin/license-checker /bin/license-checker + +WORKDIR /github/workspace/ + +ENTRYPOINT /bin/license-checker diff --git a/Makefile b/Makefile index 8e2e68e..133f4d7 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,6 @@ all: clean deps lint test build tools: mkdir -p $(GO_PATH)/bin - $(GO_LINT) version || curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin v1.21.0 #$(GO_LICENSER) -version || GO111MODULE=off $(GO_GET) -u github.com/elastic/go-licenser deps: tools @@ -39,6 +38,7 @@ deps: tools .PHONY: lint lint: tools + $(GO_LINT) version || curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin v1.21.0 @gofmt -s -l -w $(FILES) 2>&1 | $(FAIL_ON_STDOUT) $(GO_LINT) run -v ./... diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..38207ea --- /dev/null +++ b/action.yml @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: License Checker +description: A tool for checking license headers, which theoretically supports checking all types of files. +runs: + using: docker + image: Dockerfile
