From 380104d6b769b6e06f37b4cde326e685da9dc028 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Thu, 8 Jun 2023 09:20:43 +0800 Subject: [PATCH] feature(main): test action for version (#22) Signed-off-by: cuisongliu --- .github/workflows/bot.yml | 16 +++++++--------- README.md | 2 +- pkg/setup/setup.go | 3 +-- pkg/types/load.go | 3 ++- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml index d27d4ba..0f665c9 100644 --- a/.github/workflows/bot.yml +++ b/.github/workflows/bot.yml @@ -5,7 +5,6 @@ on: - created env: GH_TOKEN: "${{ secrets.GH_PAT }}" - GH_REBOT_VERSION: "v0.0.5" jobs: comment: if: startswith(github.event.comment.body, '/release') @@ -13,11 +12,10 @@ jobs: steps: - name: Checkout the latest code uses: actions/checkout@v3 - - name: Download gh-rebot - run: | - sudo wget -q https://github.com/labring/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 + - name: Gh Rebot for Sealos + uses: labring/gh-rebot@v0.0.6-rc6 + with: + version: v0.0.6-rc6 + env: + SEALOS_TYPE: "/comment" + GH_TOKEN: "${{ secrets.GH_PAT }}" diff --git a/README.md b/README.md index 666464b..5449ff0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gh-rebot 项目说明文档 -gh-rebot 是一个针对 sealos 项目的 GitHub rebot,用于自动执行一些常见操作,如生成变更日志、发布新版本等。本文档将介绍该 rebot 的配置文件,并提供相应的使用指南。 +gh-rebot 是一个针对 sealos 项目的 GitHub rebot,用于自动执行一些常见操作,如发布新版本等。本文档将介绍该 rebot 的配置文件,并提供相应的使用指南。 ## 配置文件 diff --git a/pkg/setup/setup.go b/pkg/setup/setup.go index ac2904d..01d798f 100644 --- a/pkg/setup/setup.go +++ b/pkg/setup/setup.go @@ -24,11 +24,10 @@ import ( func Setup(cfgFile string) { var err error - logger.Debug("github env to var: %v", types.ActionConfigJSON) types.GlobalsBotConfig, err = types.LoadConfig(cfgFile) if err != nil { logger.Error(err) os.Exit(1) } - logger.Cfg(types.GlobalsBotConfig.GetDebug(), false) + logger.Debug("github env to var: %v", types.ActionConfigJSON) } diff --git a/pkg/types/load.go b/pkg/types/load.go index 988e9f2..02fed70 100644 --- a/pkg/types/load.go +++ b/pkg/types/load.go @@ -18,6 +18,7 @@ package types import ( "fmt" + "github.com/cuisongliu/logger" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/yaml" "os" @@ -42,7 +43,7 @@ func ParseConfig(filePath string) (*Config, error) { } else { return nil, errors.New("error: GH_TOKEN is not set. Please set the GH_TOKEN environment variable to enable authentication and access to the GitHub API") } - + logger.Cfg(config.Debug, false) if config.Type == "" { config.Type = TypeAction }