Skip to content
This repository was archived by the owner on Aug 26, 2023. It is now read-only.

Commit 301c10b

Browse files
authored
feature(main): fix error for action (#14)
Signed-off-by: cuisongliu <cuisongliu@qq.com>
1 parent 7f601e7 commit 301c10b

File tree

6 files changed

+49
-8
lines changed

6 files changed

+49
-8
lines changed

.github/workflows/bot.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ on:
55
- created
66
env:
77
GH_TOKEN: "${{ secrets.GH_PAT }}"
8+
GH_REBOT_VERSION: "v0.0.5"
89
jobs:
910
comment:
1011
if: startswith(github.event.comment.body, '/')
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout the latest code
1415
uses: actions/checkout@v3
15-
- name: Using gh-rebot
16-
uses: labring/gh-rebot@v0.0.6-rc1
17-
env:
18-
SEALOS_TYPE: "/comment"
16+
- name: Download gh-rebot
17+
run: |
18+
sudo wget -q https://github.com/labring/gh-rebot/releases/download/${GH_REBOT_VERSION}/gh-rebot_${GH_REBOT_VERSION#v}_linux_amd64.tar.gz
19+
sudo tar -zxf gh-rebot_${GH_REBOT_VERSION#v}_linux_amd64.tar.gz gh-rebot && chmod +x gh-rebot && sudo mv gh-rebot /usr/bin/gh-rebot
20+
gh-rebot version
21+
- name: Using sealos-rebot
22+
run: |
23+
gh-rebot comment

.github/workflows/test-bot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Github Rebot for Sealos test comment
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
env:
7+
GH_TOKEN: "${{ secrets.GH_PAT }}"
8+
jobs:
9+
if: startswith(github.event.comment.body, '/')
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout the latest code
13+
uses: actions/checkout@v3
14+
- uses: labring/gh-rebot@v0.0.6-rc2
15+
if: ${{ (github.event_name != 'push') }}
16+
env:
17+
SEALOS_TYPE: "/comment"

.github/workflows/test-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Github Rebot for Sealos PR
1+
name: Github Rebot for Sealos test PR
22

33
on:
44
- push
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v3
12-
- uses: labring/gh-rebot@v0.0.6-rc1
12+
- uses: labring/gh-rebot@v0.0.6-rc2
1313
if: ${{ (github.event_name != 'push') }}
1414
env:
1515
SEALOS_TYPE: "pr_comment"

ActionDockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM golang:1.20-alpine AS builder
2+
WORKDIR /app
3+
4+
COPY go.mod go.sum ./
5+
COPY . .
6+
7+
RUN go mod download
8+
9+
RUN CGO_ENABLED=0 GOOS=linux go build -a -o gh-rebot .
10+
11+
FROM alpine:3.16.2
12+
13+
COPY --from=builder /app/gh-rebot /app/
14+
MAINTAINER "Sealos Inc."
15+
RUN apk --no-cache add jq bash curl git git-lfs github-cli
16+
ENTRYPOINT ["/app/gh-rebot","action"]

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ RUN apk --no-cache add jq bash curl git git-lfs github-cli
88

99
COPY gh-rebot /usr/bin/
1010

11-
ENTRYPOINT ["/usr/bin/gh-rebot","action"]
11+
12+
ENTRYPOINT ["/usr/bin/gh-rebot"]
13+
14+
CMD ["--help"]

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: "Add some rebot command for sealos"
33
author: "cuisongliu"
44
runs:
55
using: 'docker'
6-
image: 'Dockerfile'
6+
image: 'ActionDockerfile'
77
branding:
88
icon: 'git-pull-request'
99
color: 'green'

0 commit comments

Comments
 (0)