diff --git a/Dockerfile b/Dockerfile index 11b8bd1..2ade5db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,14 @@ -FROM golang:1 - -LABEL "com.github.actions.name"="Issue From Template" -LABEL "com.github.actions.description"="Issue From Template" -LABEL "com.github.actions.icon"="alert-circle" -LABEL "com.github.actions.color"="green" -LABEL "repository"="https://github.com/lowply/issue-from-template" -LABEL "homepage"="https://github.com/lowply/issue-from-template" -LABEL "maintainer"="Sho Mizutani " +FROM golang:1 as builder +ENV CGO_ENABLED=0 +ENV GOOS=linux +ENV GOARCH=amd64 WORKDIR /go/src COPY src . RUN GO111MODULE=on go build -o /go/bin/main -ADD entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] +FROM alpine +RUN apk add --no-cache ca-certificates +RUN update-ca-certificates +COPY --from=builder /go/bin/main /bin/main +ENTRYPOINT main diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..dad61b2 --- /dev/null +++ b/action.yml @@ -0,0 +1,9 @@ +name: 'Issue From Template' +author: 'Sho Mizutani ' +description: 'A GitHub Action that opens an issue from an issue template' +runs: + using: 'docker' + image: 'Dockerfile' +branding: + icon: 'alert-circle' + color: 'green' diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index 9e5a120..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ -z "$GITHUB_TOKEN" ]; then - echo "GITHUB_TOKEN is missing" - exit 1 -fi - -/go/bin/main