Commit Graph

209 Commits

Author SHA1 Message Date
appleboy e344b3ec67 ci: add webhook environment variables to lint workflow
- Add environment variables for `WEBHOOK_ID` and `WEBHOOK_TOKEN` in the lint workflow.

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 17:16:02 +08:00
appleboy 8533df8e0b refactor: enhance file upload functionality with context and error handling
- 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>
v1.4.0
2025-03-08 17:10:53 +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 3721fc313d feat: validate configuration fields in Exec method
- 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>
2025-03-08 16:56:57 +08:00
appleboy cea35a9ac9 fix: fix error handling for empty HTTP responses
- Change the condition to check for `http.StatusNoContent` instead of `http.StatusOK` before returning an error.

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 16:53:12 +08:00
appleboy e80db3da6a chore: update base image to Alpine 3.21
- Update the base image from alpine version 3.17 to 3.21

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 16:44:54 +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 ffa230b880 docs: refine API documentation and improve grammatical consistency
- 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>
2025-03-08 16:38:35 +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 4d1d86d8c2 docs: clean up documentation by removing unnecessary comments
- Remove a commented-out line from the documentation file

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-03-08 16:35:19 +08:00
appleboy 53d0f6ec67 chore: configure golangci-lint with multiple linters and settings
- 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>
2025-03-08 16:30:04 +08:00
appleboy 91c0d241df refactor: refactor GitHub event handling in Template function
- 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>
2025-03-08 16:29:54 +08:00
appleboy 223b0aa14f chore: upgrade Go version and dependencies in workflow settings
- 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>
v1.3.3
2025-03-08 16:22:17 +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
appleboy 01518e5a92 style: refactor codebase for consistency and performance improvements
- Change single quotes to double quotes in the custom funding URL

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-10-10 02:22:19 +08:00
appleboy 7478381b56 ci: refactor and optimize backend API handling
- Update Docker login action to use version 3 instead of version 2

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-10-10 02:21:59 +08:00
appleboy c96089116d chore: simplify and clean up build and release processes
- 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>
2024-10-06 10:08:58 +08:00
appleboy e17a1e9920 ci: streamline build process for multi-architecture support
- 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>
2024-10-06 09:46:49 +08:00
appleboy 51f0b338c5 ci: enhance CI pipeline for Go projects
- 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>
2024-10-04 21:06:18 +08:00
appleboy 2e8d61dcf2 chore: update dependencies to latest versions
- 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>
2024-06-28 22:03:48 +08:00
appleboy d80fc1adb6 chore: update CI workflows and dependencies
- Update `docker/build-push-action` to version 6
- Update `goreleaser/goreleaser-action` to version 6

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-06-28 21:55:35 +08:00
Bo-Yi Wu 1b92a095c1 ci: update GitHub Actions lint workflow configuration
- Update the golangci-lint-action version from `v5` to `v6` in the GitHub Actions lint workflow

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
v1.3.2
2024-05-16 16:14:33 +08:00
qwerty287 8a872ab32f fix: icon URL (#60) 2024-05-16 16:10:54 +08:00
Bo-Yi Wu 17f7e18d78 chore: refine Docker setup and configuration
- 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>
v1.3.1
2024-04-29 15:42:37 +08:00
Bo-Yi Wu 59b6fbbaf2 ci: enhance CI workflows and test robustness
- Update the Codecov action version from `v3` to `v4` in the lint workflow

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2024-04-29 15:24:01 +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
Bo-Yi Wu 6dc40cfa7f chore: update build and linting configurations
- 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>
2024-04-29 15:21:46 +08:00
Bo-Yi Wu 7e5539d30c chore: update dependencies to latest versions
- 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>
2024-04-29 15:20:48 +08:00
appleboy 3f344cdf2e chore: update version of actions/setup-go in GitHub workflows
- 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>
2023-12-24 19:12:48 +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 881339ea8f chore: refactor project configuration files
- Delete the `.editorconfig` file
- Add the `.gitignore` file

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-12-24 19:06:07 +08:00
appleboy af8276f8fa chore: update dependencies to latest versions
- 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>
2023-12-24 19:03:27 +08:00
appleboy 2586433815 chore: update dependency
Signed-off-by: appleboy <appleboy.tw@gmail.com>
v1.3.0
2023-09-24 21:55:01 +08:00
appleboy 69a9056c05 chore(makefile): remove unused build command
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 20:02:43 +08:00
appleboy 17058ff053 docs: remove unused badge
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:50:53 +08:00
appleboy 242a4e9588 chore: discordapp.com is deprecated
fix https://github.com/appleboy/drone-discord/issues/41

ref: https://github.com/discordjs/discord.js/pull/4160

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:48:11 +08:00
more-pepsi 4bb2c902ad docs: add config example to usage. (#37) 2023-09-24 19:39:51 +08:00
appleboy 22c00bf3c3 fix: binary name
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:39:19 +08:00
appleboy f3724e17a2 chore(CI): setup tool
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:33:42 +08:00
appleboy 9d765d231b chore(go): bump dependency version
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:30:56 +08:00
appleboy 26bd0641dc chore(CI): update lint
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:29:59 +08:00
appleboy cb38b0a194 chore(CI): bump version
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:28:05 +08:00
appleboy 5144ba01a7 chore(CI): add goreleaser
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:25:10 +08:00
appleboy a1c6d30b44 chore(docker): update dockerfile
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:24:23 +08:00
appleboy bf68bcb2b9 chore: update makefile
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 19:22:20 +08:00
appleboy 6d07c7dd06 chore: add github actions
Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-09-24 18:59:04 +08:00
Bo-Yi Wu e282060e04 chore: update Go version and dependencies
- Update Go version from 1.13 to 1.20
- Update dependencies: godotenv to v1.5.1, testify to v1.8.2, and urfave/cli to v1.22.13
- Add several new indirect dependencies

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-05-24 08:57:46 +08:00
Bo-Yi Wu f760d3a7a8 ci: refactor CI/CD pipeline and remove unused configs
- Remove .appveyor.yml file
- Delete .drone.jsonnet file
- Remove .drone.yml file
- Update build and deployment steps in the pipeline
- Add notifications and manifest steps in the pipeline

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-05-24 08:56:14 +08:00
Nils 7ac022b650 allow not setting a username for messages (closes #38) (#39) 2023-05-13 23:04:59 +08:00