Skip to content

Commit

Permalink
Use pre-built binary (#65)
Browse files Browse the repository at this point in the history
Signed-off-by: Galo Navarro <[email protected]>
  • Loading branch information
srvaroa authored Feb 19, 2023
1 parent b80822f commit 5245b69
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea
coverage.out
action
action.tar.gz
15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" \
Expand All @@ -7,11 +7,8 @@ LABEL "com.github.actions.name"="Condition-based Pull Request labeller" \
"maintainer"="Galo Navarro <[email protected]>" \
"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"]
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 5245b69

Please sign in to comment.