Skip to content

Commit

Permalink
feature(main): test action for version (#22)
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu authored Jun 8, 2023
1 parent 4d3fc9a commit 380104d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ on:
- created
env:
GH_TOKEN: "${{ secrets.GH_PAT }}"
GH_REBOT_VERSION: "v0.0.5"
jobs:
comment:
if: startswith(github.event.comment.body, '/release')
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/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/[email protected]
with:
version: v0.0.6-rc6
env:
SEALOS_TYPE: "/comment"
GH_TOKEN: "${{ secrets.GH_PAT }}"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gh-rebot 项目说明文档

gh-rebot 是一个针对 sealos 项目的 GitHub rebot,用于自动执行一些常见操作,如生成变更日志、发布新版本等。本文档将介绍该 rebot 的配置文件,并提供相应的使用指南。
gh-rebot 是一个针对 sealos 项目的 GitHub rebot,用于自动执行一些常见操作,如发布新版本等。本文档将介绍该 rebot 的配置文件,并提供相应的使用指南。

## 配置文件

Expand Down
3 changes: 1 addition & 2 deletions pkg/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
3 changes: 2 additions & 1 deletion pkg/types/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package types

import (
"fmt"
"github.com/cuisongliu/logger"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/yaml"
"os"
Expand All @@ -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
}
Expand Down

0 comments on commit 380104d

Please sign in to comment.