35 Commits

Author SHA1 Message Date
appleboy d661b29efe feat: add debug mode for plugin configuration dumping
- Add a new dependency for godump in go.mod
- Import godump in main.go
- Introduce a debug flag in the CLI options
- Update the run function to include the debug flag
- Add logic to dump the plugin configuration if debug mode is enabled
- Extend the plugin struct to include a debug field

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 22:37:30 +08:00
appleboy 217a6b17eb docs: clarify usage descriptions for webhook and build parameters
- Update usage descriptions for various webhook parameters to provide clearer context.
- Improve clarity in usage statements for Discord webhook configurations.
- Enhance descriptions for build-related parameters to better explain their purpose.
- Revise usage text for GitHub Actions parameters to ensure consistency and clarity.

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 17:07:21 +08:00
appleboy a58131af2a feat: add support for Discord webhook URL configuration and validation
- Add a new command-line flag for the Discord webhook URL
- Update the configuration structure to include the webhook URL
- Implement validation for the webhook URL format
- Introduce a method to retrieve the webhook URL from the configuration
- Refactor the code to use the new method for generating the webhook URL in multiple places

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 17:03:50 +08:00
appleboy 6c782afaae feat: add context support to Exec and SendMessage functions
- Update the `Exec` function to accept a context parameter.
- Modify the `SendMessage` function to also accept a context parameter.
- Add context import to the necessary files.
- Update test cases to pass a context when calling `Exec`.

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 16:43:06 +08:00
appleboy f2bd7836ef refactor: refactor HTTP request handling and improve linter settings
- Remove the `exportloopref` linter from the golangci configuration
- Add the `strconv` package import in `main.go`
- Replace the `fmt.Sprintf` for the year with `strconv.Itoa` to convert the year to a string
- Update the HTTP request method to use `http.MethodPost` instead of a string literal in `plugin.go`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 16:36:43 +08:00
appleboy 5e71b59c72 chore: upgrade dependencies and refine CLI configuration
- Update `github.com/stretchr/testify` from version `1.9.0` to `1.10.0`
- Update `github.com/urfave/cli` to version `v2.27.6` and change import path to include `/v2`
- Update `github.com/cpuguy83/go-md2man/v2` from version `2.0.4` to `2.0.5`
- Add `github.com/xrash/smetrics` as a new indirect dependency
- Change `cli.Author` to use a pointer type
- Update environment variable fields in multiple `cli.StringFlag` definitions to use `EnvVars` instead of `EnvVar`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 16:20:27 +08:00
qwerty287 2000a2e484 Add Woodpecker support to docs (#57)
* Update README.md

* Add files via upload

* Update DOCS.md

* Update main.go
2024-04-29 15:23:23 +08:00
appleboy 692f7ff6dd 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>
2023-12-24 19:09:34 +08:00
appleboy 26bd0641dc chore(CI): update lint
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:29:59 +08:00
Bo-Yi Wu 30be2b99d7 update build time format
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-07-23 12:16:10 +08:00
Bo-Yi Wu 546c9b8541 chore: update build name
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-07-21 10:30:27 +08:00
Bo-Yi Wu 8567e2de7b chore: load env from /run/drone/env path 2020-07-17 23:24:45 +08:00
Bo-Yi Wu 5804cc4e37 chore: support for kubernetes runner (#32)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-07-01 21:11:32 +08:00
Bo-Yi Wu 11c87968e4 chore: update int64 to float64 2019-10-24 00:04:26 +08:00
Bo-Yi Wu 4df8911cdf fix: #21 update build.started env 2019-10-13 02:07:28 +08:00
Bo-Yi Wu 82e100bf9a update time format
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-10-13 01:47:31 +08:00
Bo-Yi Wu 1ab023c10d chore: update drone env 2019-10-12 23:33:06 +08:00
Bo-Yi Wu aecc652459 chore: support github actions 2019-10-04 21:13:53 +08:00
Bo-Yi Wu f7ade7c458 feat(api): support upload file (#18)
fix #17
2019-02-25 17:18:39 +08:00
Bo-Yi Wu 28fc4d6511 feat: support default message for GitHub Action 2019-02-24 13:07:12 +08:00
Bo-Yi Wu 4aa0bd8fc6 feat: add message env 2019-02-24 11:54:57 +08:00
Bo-Yi Wu 9815f76352 add github env
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-02-19 09:14:30 +08:00
Bo-Yi Wu 900ab2cdd7 add year in copyright
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-01-23 09:51:26 +08:00
Maciej Lisiewski 7368d72005 Fix refspec - use correct env var name (#13)
It's `DRONE_COMMIT_REF` in both 0.8 and 1.0

https://0-8-0.docs.drone.io/environment-reference/
https://docs.drone.io/reference/environ/drone-commit-ref/
2019-01-12 00:35:17 +08:00
Bo-Yi Wu bf2a768f52 fix(lint): check return error. (#9) 2018-05-28 22:28:58 +08:00
Bo-Yi Wu 834f686c9c chore(var): add new env variable. (#4) 2017-08-14 09:18:44 +08:00
Bo-Yi Wu cad7d92b58 add commit ref (#1)
* add commit ref

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update to RefSpec

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-17 02:42:05 -05:00
Bo-Yi Wu 59a4e31bde add drone default template.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-17 11:31:23 +08:00
Bo-Yi Wu 2ee04c1fb0 Add color
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-14 14:51:15 +08:00
Bo-Yi Wu 13351b0dc6 add default template
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-14 12:24:45 +08:00
Bo-Yi Wu e4a13b26fb add Embed payload
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-14 11:03:44 +08:00
Bo-Yi Wu 100ff18145 update struct.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-10 17:42:11 +08:00
Bo-Yi Wu 3b65f97d8f rename content to message
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-10 17:28:05 +08:00
Bo-Yi Wu 84ee42a6e4 udpate testing.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-10 13:01:10 +08:00
Bo-Yi Wu 24befab16f initial project
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-10 11:14:12 +08:00