From a079f6c73367ac050fbfa21ff2f20770d3c6b7da Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Sat, 29 Apr 2023 21:27:52 +0800 Subject: [PATCH] feature(main): fix rebot --- .github/workflows/bot.yml | 23 +++++++++++++ .github/workflows/test-comment.yml | 53 ------------------------------ 2 files changed, 23 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/bot.yml delete mode 100644 .github/workflows/test-comment.yml diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml new file mode 100644 index 0000000..8e49076 --- /dev/null +++ b/.github/workflows/bot.yml @@ -0,0 +1,23 @@ +name: Github Rebot for Sealos +on: + issue_comment: + types: + - created +env: + GH_TOKEN: "${{ secrets.GH_PAT }}" + GH_REBOT_VERSION: "v0.0.3-rc6" +jobs: + comment: + if: startswith(github.event.comment.body, '/') + runs-on: ubuntu-latest + steps: + - name: Checkout the latest code + uses: actions/checkout@v3 + - name: Download gh-rebot + run: | + sudo wget -q https://github.com/labring-actions/gh-rebot/releases/download/${GH_REBOT_VERSION}/gh-rebot_${GH_REBOT_VERSION#v}_linux_amd64.tar.gz + 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 + gh-rebot version + - name: Using sealos-rebot + run: | + gh-rebot comment diff --git a/.github/workflows/test-comment.yml b/.github/workflows/test-comment.yml deleted file mode 100644 index 58d03ed..0000000 --- a/.github/workflows/test-comment.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: TestSuit-comment -on: - issue_comment: - types: - - created -env: - # Common versions - GH_TOKEN: "${{ secrets.GH_PAT }}" -jobs: - build-bot: - if: startswith(github.event.comment.body, '/') - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.x - uses: actions/setup-go@v2 - with: - go-version: 1.20.x - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v1 - with: - version: latest - args: build --snapshot --clean --timeout=1h - - - name: Save Binaries - uses: actions/upload-artifact@v3 - with: - name: gh-rebot - path: dist/gh-rebot_linux_amd64_v1/gh-rebot - test: - needs: [ build-bot ] - name: Build - runs-on: ubuntu-latest - strategy: - matrix: - sub: - - comment - steps: - - name: Checkout - uses: actions/checkout@master - - name: Download gh-rebot - uses: actions/download-artifact@v3 - with: - name: gh-rebot - path: /tmp/ - - - name: Test sub cmd - run: | - sudo chmod a+x /tmp/gh-rebot - /tmp/gh-rebot ${{ matrix.sub }}