From 5245b6940c8444d38ca951d842f40e3263abbd8a Mon Sep 17 00:00:00 2001 From: Galo Navarro Date: Sun, 19 Feb 2023 21:28:49 +0100 Subject: [PATCH] Use pre-built binary (#65) Signed-off-by: Galo Navarro --- .gitignore | 1 + Dockerfile | 15 ++++++--------- README.md | 6 +++++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index a19b0ab..5a222d1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .idea coverage.out action +action.tar.gz diff --git a/Dockerfile b/Dockerfile index 86ea39f..569f798 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.12-alpine +FROM alpine:3.17.2 LABEL "com.github.actions.name"="Condition-based Pull Request labeller" \ "com.github.actions.description"="Automatically label pull requests based on rules" \ @@ -7,11 +7,8 @@ LABEL "com.github.actions.name"="Condition-based Pull Request labeller" \ "maintainer"="Galo Navarro " \ "repository"="https://github.com/srvaroa/labeler" -RUN apk add --no-cache git - -WORKDIR /go/src/app -COPY . . -ENV GO111MODULE=on -ENV GOPROXY=https://proxy.golang.org -RUN go build -o action ./cmd -ENTRYPOINT ["/go/src/app/action"] +WORKDIR / +ARG ASSET_URL=https://github.com/srvaroa/labeler/releases/latest/download/action.tar.gz +RUN apk --no-cache add curl +RUN curl -sSL $ASSET_URL | tar xzvf - +ENTRYPOINT ["/action"] diff --git a/README.md b/README.md index 575c563..79c8f84 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ to date. ### How to trigger action To trigger the action on events, add a file `.github/workflows/main.yml` -to your repository with these contents: +to your repository: ```yaml name: Label PRs @@ -50,6 +50,10 @@ jobs: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" ``` +Using `@master` will run the latest available release. Feel free to pin +this to a specific version from the [releases +page](https://github.com/srvaroa/labeler/releases). + Use the [`on` clause](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) to control when to run it.