- Add documentation note explaining that in Woodpecker 3.x, build.status is always "success", which affects message templates
- Recommend using the when.status condition to separate success and failure notifications, with example YAML provided
- Clarify that this issue results from upstream Woodpecker CI changes and is not fixable in the plugin
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Remove `DIST` variable definition
- Update the `GOFMT` definition by removing the `-s` flag
- Install `gofumpt` latest version instead of an unspecified version
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Clean path and check accessibility before reading file
- Replace file reading with `os.ReadFile` for simpler code
- Remove deferred file closing as file is read into `content`
- Write file content directly to multipart form
- Add comments for clearer code sections
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Handle custom color by trimming the prefix '#'
- Refactor predefined status colors into a map
- Simplify status color handling code
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update golangci-lint-action used version from `v6` to `v7`
- Set specific golangci-lint version to `v2.0` instead of latest
- Remove `run` section with timeout setting in `.golangci.yaml`
- Eliminate multiple linters (`errcheck`, `gci`, `gofmt`, `goimports`) from `.golangci.yaml`
- Change `linters-settings` to `settings` in `.golangci.yaml`
- Add `int-conversion: true` to `perfsprint` settings
- Add new exclusion settings for generated code, preset rules, and specific paths under `exclusions` in `.golangci.yaml`
- Incorporate formatter settings with enabled formatters and exclusions for certain paths in `.golangci.yaml`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a check for empty messages in the configuration
- Replace the original message handling with a filtered list of non-empty messages
- Update the logic to process messages only if the filtered list is not empty
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- 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>
- Replace direct reading of response body with error handling for reading
- Add JSON unmarshalling of the response body for better error reporting
- Improve error message format to include details from the JSON response
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Enhance error reporting by including the response body in the error message when message sending fails.
- Remove the previous error message that only included the status code.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Rename the function `newfileUploadRequest` to `fileUploadRequest`
- Add context parameter to the `fileUploadRequest` function
- Improve error handling by wrapping errors with descriptive messages
- Update the `Exec` method to pass context when calling `SendFile`
- Rename the `SendFile` method to accept context as a parameter
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- 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>
- 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>
- Remove the import of the errors package
- Add a validate method to the Config type to check for missing fields
- Update the Exec method to use the new validate method for configuration validation
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Change the condition to check for `http.StatusNoContent` instead of `http.StatusOK` before returning an error.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- 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>
- Correct grammatical errors in descriptions, changing "message" to "messages" and "Webhook" to "Webhooks."
- Update "API document information" to "API documentation."
- Change "Sending discord message" to "Send Discord messages."
- Clarify the list of supported OS types in the binaries section.
- Improve phrasing for building the binary and sending notifications.
- Capitalize "Binary," "Docker," and "Drone CI" for consistency.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- 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>
- Add a new configuration file for golangci-lint
- Set a timeout of 5 minutes for linting
- Enable multiple linters including asciicheck, errcheck, and gofmt
- Configure settings for the gosec linter with specific rule inclusions
- Add settings for the perfsprint linter to check various error handling practices
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Refactor the handling of GitHub events in the Template function
- Replace the message construction with a switch statement for better clarity
- Simplify the logic for determining the branch in pull requests
- Update the case structure for handling different build events
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update Go version from 1.20 to 1.23.0
- Change Go versions in the workflow from 1.21, 1.22, 1.23 to 1.23, 1.24
- Upgrade Codecov action from version 4 to version 5
- Update indirect dependencies for golang.org/x/crypto and golang.org/x/sys to newer versions
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- 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>
- Update `GOFMT` command to include `-s` and `-w` flags
- Remove redundant `DIST` and `DIST_DIRS` definitions
- Remove unused variables and dependencies
- Remove `.PHONY` targets and associated release tasks
- Simplify `clean` target by removing `$(DIST)` directory from the removal list
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Remove `build_linux_arm` target from Makefile
- Remove `make build_linux_arm` step from Docker workflow
- Update Docker workflow to build for `linux/amd64` and `linux/arm64` platforms only
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Rename job from `testing` to `test`
- Add matrix strategy to test on multiple Go versions (1.21, 1.22, 1.23)
- Set up Go environment variables `GO111MODULE` and `GOPROXY`
- Replace `actions/checkout@v4` with `actions/setup-go@v5` for setting up Go
- Add caching for Go build and module directories using `actions/cache@v4`
- Change test command from `make test` to `go test -v -covermode=atomic -coverprofile=coverage.out`
- Add flags to `codecov/codecov-action@v4` for matrix OS and Go version
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update `github.com/huandu/xstrings` from v1.4.0 to v1.5.0
- Update `golang.org/x/crypto` from v0.22.0 to v0.24.0
- Update `golang.org/x/sys` from v0.19.0 to v0.21.0
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a new `.hadolint.yaml` configuration file with specific rule ignores
- Update the Dockerfile to install `ca-certificates` without a fixed version
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update CodeQL GitHub Actions from v2 to v3 in codeql.yml
- Change goreleaser argument from `--rm-dist` to `--clean` in goreleaser.yml
- Update golangci-lint GitHub Action from v3 to v5 in lint.yml
- Update the Docker container for linting from golang:1.19-alpine to golang:1.22-alpine in lint.yml
- Standardize quotes around `checksums.txt` in .goreleaser.yaml
- Add changelog configuration with groups for features, bug fixes, enhancements, refactor, build process updates, documentation updates, and others in .goreleaser.yaml
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `github.com/stretchr/testify` to version `1.9.0`
- Update `github.com/urfave/cli` to version `1.22.15`
- Update `github.com/cpuguy83/go-md2man/v2` to version `2.0.4`
- Update `github.com/google/uuid` to version `1.6.0`
- Update `github.com/shopspring/decimal` to version `1.4.0`
- Update `golang.org/x/crypto` to version `0.22.0`
- Update `golang.org/x/sys` to version `0.19.0`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update the version of `actions/setup-go` from `v4` to `v5` in the `.github/workflows/docker.yml` file
- Update the version of `actions/setup-go` from `v4` to `v5` in the `.github/workflows/goreleaser.yml` file
- Update the version of `actions/setup-go` from `v4` to `v5` in the `.github/workflows/lint.yml` file
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- 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>
- Update the version of `github.com/cpuguy83/go-md2man/v2` from `v2.0.2` to `v2.0.3`
- Update the version of `github.com/google/uuid` from `v1.3.1` to `v1.5.0`
- Update the version of `github.com/sirupsen/logrus` from `v1.8.1` to `v1.9.3`
- Update the version of `github.com/spf13/cast` from `v1.5.1` to `v1.6.0`
- Update the version of `golang.org/x/crypto` from `v0.13.0` to `v0.17.0`
- Update the version of `golang.org/x/sys` from `v0.12.0` to `v0.15.0`
Signed-off-by: appleboy <appleboy.tw@gmail.com>