diff --git a/Dockerfile b/Dockerfile index d3b0160..2ade5db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,14 @@ -FROM golang:1 - -LABEL "com.github.actions.name"="Auto Closer" -LABEL "com.github.actions.description"="Auto Closer" -LABEL "com.github.actions.icon"="check-circle" -LABEL "com.github.actions.color"="red" -LABEL "repository"="https://github.com/lowply/auto-closer" -LABEL "homepage"="https://github.com/lowply/auto-closer" -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..62ab315 --- /dev/null +++ b/action.yml @@ -0,0 +1,9 @@ +name: 'Auto Closer' +author: 'Sho Mizutani ' +description: 'A GitHub Action that closes all issues with a specific label while keeping the latest one(s) open.' +runs: + using: 'docker' + image: 'Dockerfile' +branding: + icon: 'check-circle' + color: 'red' 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