feat: add support for specifying source branch in build configuration

- Add a new flag `source.branch` with default value `develop` and usage description "git source branch"
- Add a new struct `Source` with a `Branch` field
- Add a new field `Source` to the existing struct `Build`
- Add a new test case with `Source.Branch` set to "feature/awesome-feature"

Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
appleboy
2023-12-24 19:09:34 +08:00
parent 881339ea8f
commit 692f7ff6dd
3 changed files with 17 additions and 0 deletions
+3
View File
@@ -34,6 +34,9 @@ func TestTemplate(t *testing.T) {
Link: "https://github.com/appleboy/go-hello",
Event: "tag",
},
Source: Source{
Branch: "feature/awesome-feature",
},
Config: Config{
WebhookID: os.Getenv("WEBHOOK_ID"),