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

Commit 80bdaaa

Browse files
authored
New pr test (#26)
* feature(main): add test for pr Signed-off-by: cuisongliu <cuisongliu@qq.com> * feature(main): add test for pr Signed-off-by: cuisongliu <cuisongliu@qq.com> --------- Signed-off-by: cuisongliu <cuisongliu@qq.com>
1 parent 10200df commit 80bdaaa

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/test-bot.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
- name: Copy file
2222
run: |
2323
sudo cp dist/gh-rebot_linux_amd64_v1/gh-rebot /usr/bin/gh-rebot
24-
- if: ${{ (github.event_name != 'push') }}
25-
run: |
24+
- run: |
2625
gh-rebot action
2726
env:
2827
SEALOS_TYPE: "/comment"

cmd/action.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ var actionCmd = &cobra.Command{
3636
os.Exit(1)
3737
}
3838
},
39+
PreRun: func(cmd *cobra.Command, args []string) {
40+
setup.Setup(cfgFile)
41+
},
3942
}
4043

4144
func init() {
42-
cobra.OnInitialize(func() {
43-
setup.Setup(cfgFile)
44-
})
4545
rootCmd.AddCommand(actionCmd)
4646

4747
// Here you will define your flags and configuration settings.

cmd/webhook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ var webhookCmd = &cobra.Command{
2020
logger.Fatal(err, "unable to init http server")
2121
}
2222
},
23+
PreRun: func(cmd *cobra.Command, args []string) {
24+
setup.Setup(cfgFile)
25+
},
2326
}
2427

2528
func init() {
26-
cobra.OnInitialize(func() {
27-
setup.Setup(cfgFile)
28-
})
2929
rootCmd.AddCommand(webhookCmd)
3030

3131
// Here you will define your flags and configuration settings.

pkg/types/config_data/gh_env.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"action": "created",
33
"comment": {
44
"author_association": "CONTRIBUTOR",
5-
"body": "/sealos_bot_release v1.2.3fdsjfkjhgjkhfjkgf.fdgfkjgkjfd.dsajkgfdskgkfdjgkljdfklgj fdkjfkldj",
5+
"body": "/gkjfd.dsajkgfdskgkfdjgkljdfklgj fdkjfkldj",
66
"created_at": "2023-04-17T04:55:26Z",
77
"html_url": "https://github.com/labring/gh-rebot/issues/1#issuecomment-1510696770",
88
"id": 1510696770,

0 commit comments

Comments
 (0)