Compare commits

...

113 Commits

Author SHA1 Message Date
woodpecker-bot ff27774e34 fix(deps): update module github.com/urfave/cli/v3 to v3.10.0 2026-06-14 14:05:17 +00:00
woodpecker-bot 0307b473fd fix(deps): update module golang.org/x/net to v0.56.0 2026-06-13 01:06:30 +00:00
woodpecker-bot 39109f4f0d fix(deps): update module github.com/urfave/cli/v3 to v3.9.1 2026-06-13 00:06:03 +00:00
woodpecker-bot d79c1b9e73 chore(deps): update go toolchain directive to v1.26.4 2026-06-06 00:05:36 +00:00
oauth 9b54bb824c 🎉 Release 1.2.0 (#85)
This PR was opened by the [ready-release-go](https://github.com/woodpecker-ci/plugin-ready-release-go) plugin. When you're ready to do a release, you can merge this pull-request and a new release with version `1.2.0` will be created automatically. If you're not ready to do a release yet, that's fine, whenever you add more changes to `main` this pull-request will be updated.

## Options

- [ ] Mark this version as a release candidate

## [1.2.0](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v1.2.0) - 2026-05-30

###  Features

- Support CI_STEP_NAME and CI_STEP_TYPE [[#88](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/88)]

### 📦️ Dependency

- fix(deps): update module golang.org/x/net to v0.55.0 [[#86](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/86)]
- fix(deps): update module golang.org/x/net to v0.54.0 [[#84](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/84)]

Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/85
Reviewed-by: 6543 <6543@obermui.de>
2026-05-30 16:19:11 +02:00
6543 04d11d71e2 Support CI_STEP_NAME and CI_STEP_TYPE (#88)
needs https://github.com/woodpecker-ci/woodpecker/pull/4290 (woodpecker >= v3.15.0)

Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/88
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2026-05-30 16:17:54 +02:00
woodpecker-bot 6c31fd4eca fix(deps): update module golang.org/x/net to v0.55.0 (#86)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/86
2026-05-25 11:25:46 +02:00
woodpecker-bot 6d2dd250f2 fix(deps): update module github.com/urfave/cli/v3 to v3.9.0 2026-05-16 00:06:01 +00:00
woodpecker-bot b9901cb0a4 fix(deps): update module golang.org/x/net to v0.54.0 (#84)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/84
2026-05-09 08:30:54 +02:00
woodpecker-bot 35e4580f92 chore(deps): update go toolchain directive to v1.26.3 2026-05-09 00:07:23 +00:00
woodpecker-bot 7c2ff72c02 fix(deps): update module github.com/rs/zerolog to v1.35.1 2026-04-25 00:06:29 +00:00
woodpecker-bot 8cc8f11ed6 chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v4.1.1 2026-04-18 00:06:55 +00:00
woodpecker-bot c437b69716 fix(deps): update module golang.org/x/net to v0.53.0 2026-04-11 01:04:23 +00:00
woodpecker-bot ff7388263c chore(deps): update dependency go to v1.26.2 2026-04-11 00:06:09 +00:00
oauth deb8bebb75 🎉 Release 1.1.0 (#83)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/83
Co-authored-by: oauth <woodpecker-bot@obermui.de>
Co-committed-by: oauth <woodpecker-bot@obermui.de>
2026-03-30 16:35:24 +02:00
qwerty287 715e1e0802 Fix lint 2026-03-30 16:33:30 +02:00
qwerty287 c8a8fc1983 Format code 2026-03-30 16:31:40 +02:00
OCram85 320f95afae feat(flags): adds support for http proxy config (#82)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/82
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-authored-by: OCram85 <marco.blessing@googlemail.com>
Co-committed-by: OCram85 <marco.blessing@googlemail.com>
2026-03-30 16:29:13 +02:00
woodpecker-bot 4fba2ed06e fix(deps): update module github.com/urfave/cli/v3 to v3.8.0 2026-03-28 02:04:40 +00:00
woodpecker-bot 64071307b1 fix(deps): update module github.com/rs/zerolog to v1.35.0 2026-03-28 01:05:09 +00:00
woodpecker-bot 00f2fd05f9 chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v4.1.0 2026-03-28 00:05:26 +00:00
woodpecker-bot 4cfd9035eb fix(deps): update module golang.org/x/net to v0.52.0 2026-03-14 00:05:10 +00:00
oauth e8db412499 🎉 Release 1.0.3 (#77)
This PR was opened by the [ready-release-go](https://github.com/woodpecker-ci/plugin-ready-release-go) plugin. When you're ready to do a release, you can merge this pull-request and a new release with version `1.0.3` will be created automatically. If you're not ready to do a release yet, that's fine, whenever you add more changes to `main` this pull-request will be updated.

## Options

- [ ] Mark this version as a release candidate

## [1.0.3](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v1.0.3) - 2026-03-07

### 📦️ Dependency

- fix(deps): update module github.com/urfave/cli/v3 to v3.7.0 [[#80](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/80)]
- chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v4 [[#78](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/78)]
- fix(deps): update module golang.org/x/net to v0.51.0 [[#79](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/79)]
- chore(deps): update dependency go to v1.26.0 [[#74](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/74)]
- chore(deps): update golang docker tag to v1.26 [[#75](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/75)]
- fix(deps): update module golang.org/x/net to v0.50.0 [[#76](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/76)]

Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/77
Reviewed-by: Lauris BH <lafriks@noreply.codeberg.org>
Co-authored-by: oauth <woodpecker-bot@obermui.de>
Co-committed-by: oauth <woodpecker-bot@obermui.de>
2026-03-11 17:16:33 +01:00
woodpecker-bot 685ac42fc4 chore(deps): update dependency go to v1.26.1 2026-03-07 00:05:47 +00:00
woodpecker-bot f0168dce22 fix(deps): update module github.com/urfave/cli/v3 to v3.7.0 (#80)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/80
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2026-03-03 09:17:44 +01:00
woodpecker-bot a811e40032 chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v4 (#78)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/78
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2026-02-28 08:13:43 +01:00
woodpecker-bot e5e33d41e5 fix(deps): update module golang.org/x/net to v0.51.0 (#79)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/79
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2026-02-28 08:04:12 +01:00
woodpecker-bot 8eadd31abf chore(deps): update dependency go to v1.26.0 (#74)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/74
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2026-02-14 08:52:34 +01:00
woodpecker-bot aded02e977 chore(deps): update golang docker tag to v1.26 (#75)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/75
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2026-02-14 08:52:15 +01:00
woodpecker-bot 9e3162422c fix(deps): update module golang.org/x/net to v0.50.0 (#76)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/76
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2026-02-14 08:52:00 +01:00
woodpecker-bot e9e7d50eb6 chore(deps): update dependency go to v1.25.7 2026-02-07 00:08:34 +00:00
woodpecker-bot 5959a73881 fix(deps): update module github.com/urfave/cli/v3 to v3.6.2 2026-01-31 16:04:49 +00:00
woodpecker-bot dc3aea27df fix(deps): update module golang.org/x/net to v0.49.0 2026-01-17 01:08:11 +00:00
woodpecker-bot 87698ede13 chore(deps): update dependency go to v1.25.6 2026-01-17 00:11:52 +00:00
woodpecker-bot 3393bdb542 chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.4.1 2026-01-10 05:02:57 +00:00
oauth 2dd0dc173f 🎉 Release 1.0.2 (#68)
This PR was opened by the [ready-release-go](https://github.com/woodpecker-ci/plugin-ready-release-go) plugin. When you're ready to do a release, you can merge this pull-request and a new release with version `1.0.2` will be created automatically. If you're not ready to do a release yet, that's fine, whenever you add more changes to `main` this pull-request will be updated.

## Options

- [ ] Mark this version as a release candidate

## [1.0.2](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v1.0.2) - 2026-01-09

### 📦️ Dependency

- fix(deps): update module github.com/urfave/cli/v3 to v3.6.0 [[#72](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/72)]
- chore(deps): update dependency go to v1.25.4 [[#71](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/71)]
- fix(deps): update module github.com/urfave/cli/v3 to v3.5.0 [[#70](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/70)]
- chore(deps): update dependency go to v1.25.3 [[#69](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/69)]
- fix(deps): update module golang.org/x/net to v0.46.0 [[#67](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/67)]
- chore(deps): update dependency go to v1.25.2 [[#66](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/66)]

Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/68
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: oauth <woodpecker-bot@obermui.de>
Co-committed-by: oauth <woodpecker-bot@obermui.de>
2026-01-09 02:04:36 +01:00
woodpecker-bot c5308d94ba fix(deps): update module golang.org/x/net to v0.48.0 2025-12-13 00:08:21 +00:00
woodpecker-bot 2f1f602de3 chore(deps): update dependency go to v1.25.5 2025-12-06 00:10:16 +00:00
woodpecker-bot 87f30c981b fix(deps): update module github.com/urfave/cli/v3 to v3.6.1 2025-11-16 20:05:56 +00:00
woodpecker-bot 60c0df20cd fix(deps): update module golang.org/x/net to v0.47.0 2025-11-15 00:07:16 +00:00
woodpecker-bot 6027b2d758 fix(deps): update module github.com/urfave/cli/v3 to v3.6.0 (#72)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/72
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-11-09 13:24:46 +01:00
woodpecker-bot 00e236ab6d chore(deps): update dependency go to v1.25.4 (#71)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/71
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-11-08 08:30:08 +01:00
woodpecker-bot 54513ba0ec fix(deps): update module github.com/urfave/cli/v3 to v3.5.0 (#70)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/70
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-10-25 08:40:50 +02:00
woodpecker-bot 14342137fa chore(deps): update dependency go to v1.25.3 (#69)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/69
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-10-18 08:26:01 +02:00
woodpecker-bot abe46c2b5d fix(deps): update module golang.org/x/net to v0.46.0 (#67)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/67
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-10-11 08:22:37 +02:00
woodpecker-bot 649294ac47 chore(deps): update dependency go to v1.25.2 (#66)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/66
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-10-11 08:21:41 +02:00
oauth 10b75b259b 🎉 Release 1.0.1 (#51)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/51
Co-authored-by: oauth <woodpecker-bot@obermui.de>
Co-committed-by: oauth <woodpecker-bot@obermui.de>
2025-09-30 14:59:41 +02:00
woodpecker-bot d25844e305 fix(deps): update module github.com/urfave/cli/v3 to v3.4.1 (#64)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/64
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-09-13 08:18:39 +02:00
woodpecker-bot ac40cced18 chore(deps): update dependency go to v1.25.1 (#61)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/61
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-09-13 08:18:24 +02:00
woodpecker-bot aa85fcbce5 fix(deps): update module github.com/stretchr/testify to v1.11.1 (#63)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/63
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-09-13 07:53:54 +02:00
woodpecker-bot 8ef4f8f9cc fix(deps): update module golang.org/x/net to v0.44.0 (#65)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/65
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-09-13 07:52:48 +02:00
woodpecker-bot a23e4f7e42 chore(deps): update golang docker tag to v1.25 (#62)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/62
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-09-13 07:52:30 +02:00
woodpecker-bot 5e6aff13a7 chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.4.0 (#59)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/59
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-08-09 08:43:06 +02:00
woodpecker-bot 6ce864b6d9 fix(deps): update module golang.org/x/net to v0.43.0 (#60)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/60
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-08-09 08:42:44 +02:00
woodpecker-bot a72f843148 chore(deps): update dependency go to v1.24.6 (#58)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/58
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-08-09 08:42:21 +02:00
woodpecker-bot 9cf9134d0e fix(deps): update module golang.org/x/net to v0.42.0 (#57)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/57
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-07-12 07:38:11 +02:00
woodpecker-bot 16d1fd423d chore(deps): update dependency go to v1.24.5 (#56)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/56
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-07-12 07:37:54 +02:00
woodpecker-bot 34d6107edb chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.3.0 (#55)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/55
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-07-05 07:33:43 +02:00
woodpecker-bot 3908f282af fix(deps): update module github.com/urfave/cli/v3 to v3.3.8 (#54)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/54
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-06-14 07:58:32 +02:00
woodpecker-bot 15556b694d fix(deps): update module golang.org/x/net to v0.41.0 (#53)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/53
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-06-09 15:34:44 +02:00
woodpecker-bot ce08e0142d chore(deps): update dependency go to v1.24.4 (#52)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/52
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-06-09 15:34:28 +02:00
woodpecker-bot 32c3c2a6f1 chore(deps): update dependency go to v1.24.3 (#50)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/50
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-05-12 06:21:43 +00:00
woodpecker-bot 8ddffff10c fix(deps): update module github.com/urfave/cli/v3 to v3.3.3 2025-05-11 00:16:10 +00:00
woodpecker-bot 7668bbb9be fix(deps): update module golang.org/x/net to v0.40.0 2025-05-10 00:09:33 +00:00
woodpecker-bot d73d41e148 fix(deps): update module github.com/urfave/cli/v3 to v3.3.2 2025-05-03 00:18:23 +00:00
woodpecker-bot fb4faa61f2 fix(deps): update module github.com/urfave/cli/v3 to v3.3.1 2025-04-27 22:06:10 +00:00
woodpecker-bot 645238beec fix(deps): update module golang.org/x/net to v0.39.0 2025-04-26 01:16:28 +00:00
woodpecker-bot 612b6a34dd chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.2.0 2025-04-26 00:10:35 +00:00
oauth dad2b481a2 🎉 Release 1.0.0 (#45)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/45
Co-authored-by: oauth <woodpecker-bot@obermui.de>
Co-committed-by: oauth <woodpecker-bot@obermui.de>
2025-04-24 07:27:30 +00:00
Robert Kaussow e3f4284781 Bump urfave/cli to v3.2.0 (#49)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/49
Reviewed-by: Patrick Schratz <pat-s@noreply.codeberg.org>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-committed-by: Robert Kaussow <mail@thegeeklab.de>
2025-04-24 06:44:11 +00:00
Robert Kaussow 044f72ed49 feat: add custom cli flags (#48)
Adds two custom cli flags:
- `StringMapFlag` parses JSON to string map used for plugin map options
- `StringSliceFlag` parses comma-separated plugin slice options to slice and supports escaping

Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/48
Reviewed-by: Patrick Schratz <pat-s@noreply.codeberg.org>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-committed-by: Robert Kaussow <mail@thegeeklab.de>
2025-04-23 18:01:11 +00:00
woodpecker-bot 94ba1fe374 fix(deps): update module github.com/urfave/cli/v3 to v3.1.1 (#47)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/47
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-04-10 04:02:45 +00:00
woodpecker-bot 89c7be805f chore(deps): update dependency go to v1.24.2 (#46)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/46
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-04-10 04:02:15 +00:00
woodpecker-bot c13a4deeba chore(deps): update golangci/golangci-lint docker tag to v2 (#44)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/44
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-03-29 05:35:22 +00:00
woodpecker-bot 770c8d6ae2 fix(deps): update module golang.org/x/net to v0.38.0 2025-03-29 01:05:29 +00:00
woodpecker-bot 9993b2b277 chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.1.4 2025-03-29 00:06:08 +00:00
woodpecker-bot 545ea71b3c fix(deps): update module github.com/rs/zerolog to v1.34.0 2025-03-22 02:03:18 +00:00
woodpecker-bot 7dffd4a970 fix(deps): update module golang.org/x/net to v0.37.0 2025-03-08 00:08:03 +00:00
oauth 4cb087c13c 🎉 Release 0.7.1 (#39)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/39
Reviewed-by: xoxys <xoxys@noreply.codeberg.org>
Co-authored-by: oauth <woodpecker-bot@obermui.de>
Co-committed-by: oauth <woodpecker-bot@obermui.de>
2025-02-16 13:43:16 +00:00
woodpecker-bot 67497c7b50 chore(deps): update golangci/golangci-lint docker tag to v1.64 (#42)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/42
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-02-16 09:28:28 +00:00
woodpecker-bot 3afdbec338 chore(deps): update golang docker tag to v1.24 (#41)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/41
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-02-16 09:19:24 +00:00
woodpecker-bot 16e5ebfe91 fix(deps): update module golang.org/x/net to v0.35.0 (#43)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/43
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-02-16 09:19:09 +00:00
woodpecker-bot 8c15dbc919 chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.1.3 (#40)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/40
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2025-01-25 06:23:13 +00:00
woodpecker-bot 33995f25c3 fix(deps): update module golang.org/x/net to v0.34.0 2025-01-11 00:05:14 +00:00
woodpecker-bot ba75700cc4 chore(deps): update golangci/golangci-lint docker tag to v1.63 2025-01-04 00:07:03 +00:00
woodpecker-bot 0db17abc92 chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.1.1 2024-12-29 19:14:34 +00:00
woodpecker-bot 0c8f2b173b fix(deps): update module golang.org/x/net to v0.33.0 2024-12-21 00:04:46 +00:00
woodpecker-bot edc91fba9e chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.1.0 2024-12-10 00:05:21 +00:00
woodpecker-bot dec7e76c4e fix(deps): update module golang.org/x/net to v0.32.0 2024-12-08 00:12:50 +00:00
woodpecker-bot 738d85cc8e chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3 (#37)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker.io/woodpeckerci/plugin-ready-release-go](https://github.com/woodpecker-ci/plugin-ready-release-go) | major | `2.1.1` -> `3.0.0` |

---

### Release Notes

<details>
<summary>woodpecker-ci/plugin-ready-release-go (docker.io/woodpeckerci/plugin-ready-release-go)</summary>

### [`v3.0.0`](https://github.com/woodpecker-ci/plugin-ready-release-go/blob/HEAD/CHANGELOG.md#300---2024-12-02)

[Compare Source](https://github.com/woodpecker-ci/plugin-ready-release-go/compare/2.1.1...3.0.0)

##### ❤️ Thanks to all contributors! ❤️

[@&#8203;6543](https://github.com/6543), [@&#8203;anbraten](https://github.com/anbraten), [@&#8203;xoxys](https://github.com/xoxys)

##### 💥 Breaking changes

-   Disable commentOnReleasedPullRequests by default \[[#&#8203;253](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/253)]

##### 📈 Enhancement

-   Add tests for changelog generation \[[#&#8203;245](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/245)]
-   Use separate build stage to install dependencies and share node_modules \[[#&#8203;244](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/244)]

##### 📦️ Dependency

-   chore(deps): lock file maintenance \[[#&#8203;252](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/252)]
-   chore(deps): update dependency prettier to v3.4.1 \[[#&#8203;251](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/251)]
-   chore(deps): update dependency [@&#8203;types/node](https://github.com/types/node) to v22.10.1 \[[#&#8203;250](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/250)]
-   chore(deps): update vitest monorepo to v2.1.6 \[[#&#8203;249](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/249)]
-   chore(deps): lock file maintenance \[[#&#8203;243](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/243)]
-   chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to v0.43.0 \[[#&#8203;241](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/241)]
-   chore(deps): update dependency [@&#8203;types/node](https://github.com/types/node) to v22.9.3 \[[#&#8203;240](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/240)]
-   chore(deps): lock file maintenance \[[#&#8203;236](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/236)]
-   chore(deps): update dependency typescript to v5.7.2 \[[#&#8203;239](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/239)]
-   chore(deps): update dependency [@&#8203;types/node](https://github.com/types/node) to v22.9.2 \[[#&#8203;238](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/238)]
-   chore(deps): update vitest monorepo to v2.1.5 \[[#&#8203;235](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/235)]
-   chore(deps): lock file maintenance \[[#&#8203;232](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/232)]
-   chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v2.1.1 \[[#&#8203;231](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/231)]
-   chore(deps): lock file maintenance \[[#&#8203;229](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/229)]

##### Misc

-   Add release-please to readme \[[#&#8203;248](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/248)]
-   Separate pr-labels to changes code into an analyser \[[#&#8203;237](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/237)]

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* * * * 0,6" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS41Ni4yIiwidXBkYXRlZEluVmVyIjoiMzkuNTYuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jeSJdfQ==-->

Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/37
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2024-12-07 10:28:39 +00:00
6543 0bb8640938 Bump min golan version to v1.20 (#36)
https://github.com/urfave/cli/issues/2024
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/36
2024-12-03 17:06:37 +00:00
woodpecker-bot 9748a14bd5 fix(deps): update module github.com/urfave/cli/v3 to v3.0.0-beta1 2024-12-01 00:15:18 +00:00
woodpecker-bot 42e963e908 fix(deps): update module github.com/stretchr/testify to v1.10.0 2024-11-24 00:14:13 +00:00
woodpecker-bot d899146040 fix(deps): update module github.com/urfave/cli/v3 to v3.0.0-alpha9.4 2024-11-23 00:05:21 +00:00
woodpecker-bot a5e5444f6a fix(deps): update module golang.org/x/net to v0.31.0 2024-11-19 00:04:47 +00:00
woodpecker-bot 54eb1bdcdd chore(deps): update woodpeckerci/plugin-reviewdog-golangci-lint docker tag to v1.61 2024-11-18 00:06:18 +00:00
woodpecker-bot daf65e94bb chore(deps): update golangci/golangci-lint docker tag to v1.62 2024-11-17 00:12:25 +00:00
woodpecker-bot 7f87818bf7 fix(deps): update module github.com/urfave/cli/v3 to v3.0.0-alpha9.3 2024-11-16 00:04:38 +00:00
oauth 00a58f4a06 🎉 Release 0.7.0 (#35)
This PR was opened by the [ready-release-go](https://github.com/woodpecker-ci/plugin-ready-release-go) plugin. When you're ready to do a release, you can merge this pull-request and a new release with version `0.7.0` will be created automatically. If you're not ready to do a release yet, that's fine, whenever you add more changes to `main` this pull-request will be updated.

## Options

- [ ] Mark this version as a release candidate

## [0.7.0](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v0.7.0) - 2024-11-13

### 📈 Enhancement

- Add support for CI_PIPELINE_FILES [[#33](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/33)]

### 📦️ Dependency

- fix(deps): update github.com/urfave/cli/v3 digest to cd7d34a [[#32](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/32)]

### Misc

- Use ready-release-go plugin [[#34](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/34)]

Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/35
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: oauth <woodpecker-bot@obermui.de>
Co-committed-by: oauth <woodpecker-bot@obermui.de>
2024-11-13 01:06:27 +00:00
6543 1d5ccf599c Use ready-release-go plugin (#34)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/34
2024-11-13 01:04:48 +00:00
6543 26cc02d9d9 Add support for CI_PIPELINE_FILES (#33)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/33
2024-11-13 01:01:15 +00:00
woodpecker-bot b43eefd089 fix(deps): update module github.com/urfave/cli/v3 to v3.0.0-alpha9.1 2024-10-19 00:08:46 +00:00
woodpecker-bot 3cf11a328e fix(deps): update module golang.org/x/net to v0.30.0 2024-10-06 00:14:58 +00:00
woodpecker-bot dc21eb0c71 fix(deps): update github.com/urfave/cli/v3 digest to 20ef97b 2024-10-05 00:08:32 +00:00
woodpecker-bot 06e90d56f8 chore(deps): update golangci/golangci-lint docker tag to v1.61 2024-09-14 00:06:55 +00:00
woodpecker-bot 33cbc07540 fix(deps): update module golang.org/x/net to v0.29.0 2024-09-08 00:20:37 +00:00
woodpecker-bot cac90b61b0 fix(deps): update github.com/urfave/cli/v3 digest to 31c5c84 2024-09-07 00:08:49 +00:00
woodpecker-bot 2b59a3028d fix(deps): update github.com/urfave/cli/v3 digest to 3d76e1b 2024-08-31 00:07:36 +00:00
woodpecker-bot 2b17135e0c fix(deps): update github.com/urfave/cli/v3 digest to cd7d34a (#32)
Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/32
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2024-08-26 06:21:25 +00:00
woodpecker-bot c79c27bb51 chore(deps): update golangci/golangci-lint docker tag to v1.60 2024-08-19 00:07:48 +00:00
woodpecker-bot 5859397549 fix(deps): update github.com/urfave/cli/v3 digest to 3110c0e 2024-08-18 00:17:52 +00:00
woodpecker-bot b9a4363bd9 chore(deps): update golang docker tag to v1.23 2024-08-17 00:07:18 +00:00
woodpecker-bot 81050b18f0 fix(deps): update module golang.org/x/net to v0.28.0 2024-08-10 00:08:54 +00:00
19 changed files with 1095 additions and 99 deletions
+69
View File
@@ -0,0 +1,69 @@
version: "2"
linters:
default: none
enable:
- bidichk
- errcheck
- errorlint
- forbidigo
- govet
- ineffassign
- misspell
- revive
- staticcheck
- unused
- whitespace
- zerologlint
settings:
errorlint:
errorf-multi: true
forbidigo:
forbid:
- pattern: context\.WithCancel$
- pattern: ^print.*$
misspell:
locale: US
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
revive:
rules:
- name: var-naming
arguments:
- []
- []
- - skipPackageNameChecks: true
skip-package-name-collision-with-go-std: true
formatters:
enable:
- gci
- gofmt
- gofumpt
settings:
gci:
sections:
- standard
- default
- prefix(go.woodpecker-ci.org/woodpecker)
custom-order: true
gofmt:
simplify: true
rewrite-rules:
- pattern: interface{}
replacement: any
gofumpt:
extra-rules: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
-34
View File
@@ -1,34 +0,0 @@
when:
- event: [pull_request, tag, cron]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
- 'renovate/*'
variables:
- &golang "golang:1.22"
- &golangci-lint "golangci/golangci-lint:v1.59-alpine"
- &reviewdog-golangci-lint "woodpeckerci/plugin-reviewdog-golangci-lint:1.59"
steps:
vendor:
image: *golang
commands: go mod vendor
review-go:
image: *reviewdog-golangci-lint
settings:
token:
from_secret: reviewdog_token
when:
event: pull_request
lint:
image: *golangci-lint
commands: golangci-lint run --timeout 5m
when:
event: [push, tag, cron]
test:
image: *golang
commands: go test --cover ./...
+24
View File
@@ -0,0 +1,24 @@
when:
- event: [pull_request, tag, cron]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
- "renovate/*"
variables:
- &golang "golang:1.26"
steps:
vendor:
image: *golang
commands: go mod vendor
lint:
image: *golang
commands: make lint
when:
event: [push, tag, cron]
test:
image: *golang
commands: make test
+14
View File
@@ -0,0 +1,14 @@
when:
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
- release/*
steps:
- name: release-helper
image: docker.io/woodpeckerci/plugin-ready-release-go:4.1.1
settings:
release_branch: ${CI_COMMIT_BRANCH}
git_email: woodpecker-bot@obermui.de
forge_token:
from_secret: gitea_token
+136
View File
@@ -0,0 +1,136 @@
# Changelog
## [1.2.0](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v1.2.0) - 2026-05-30
### ❤️ Thanks to all contributors! ❤️
@6543, @woodpecker-bot
### ✨ Features
- Support CI_STEP_NAME and CI_STEP_TYPE [[#88](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/88)]
### 📦️ Dependency
- fix(deps): update module golang.org/x/net to v0.55.0 [[#86](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/86)]
- fix(deps): update module golang.org/x/net to v0.54.0 [[#84](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/84)]
## [1.1.0](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v1.1.0) - 2026-03-30
### ❤️ Thanks to all contributors! ❤️
@OCram85
### 📈 Enhancement
- feat(flags): adds support for http proxy config [[#82](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/82)]
## [1.0.3](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v1.0.3) - 2026-03-07
### ❤️ Thanks to all contributors! ❤️
@woodpecker-bot
### 📦️ Dependency
- fix(deps): update module github.com/urfave/cli/v3 to v3.7.0 [[#80](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/80)]
- chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v4 [[#78](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/78)]
- fix(deps): update module golang.org/x/net to v0.51.0 [[#79](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/79)]
- chore(deps): update dependency go to v1.26.0 [[#74](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/74)]
- chore(deps): update golang docker tag to v1.26 [[#75](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/75)]
- fix(deps): update module golang.org/x/net to v0.50.0 [[#76](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/76)]
## [1.0.2](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v1.0.2) - 2026-01-09
### ❤️ Thanks to all contributors! ❤️
@woodpecker-bot
### 📦️ Dependency
- fix(deps): update module github.com/urfave/cli/v3 to v3.6.0 [[#72](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/72)]
- chore(deps): update dependency go to v1.25.4 [[#71](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/71)]
- fix(deps): update module github.com/urfave/cli/v3 to v3.5.0 [[#70](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/70)]
- chore(deps): update dependency go to v1.25.3 [[#69](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/69)]
- fix(deps): update module golang.org/x/net to v0.46.0 [[#67](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/67)]
- chore(deps): update dependency go to v1.25.2 [[#66](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/66)]
## [1.0.1](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v1.0.1) - 2025-09-13
### ❤️ Thanks to all contributors! ❤️
@woodpecker-bot
### 📦️ Dependency
- fix(deps): update module github.com/urfave/cli/v3 to v3.4.1 [[#64](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/64)]
- chore(deps): update dependency go to v1.25.1 [[#61](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/61)]
- fix(deps): update module github.com/stretchr/testify to v1.11.1 [[#63](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/63)]
- fix(deps): update module golang.org/x/net to v0.44.0 [[#65](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/65)]
- chore(deps): update golang docker tag to v1.25 [[#62](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/62)]
- chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.4.0 [[#59](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/59)]
- fix(deps): update module golang.org/x/net to v0.43.0 [[#60](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/60)]
- chore(deps): update dependency go to v1.24.6 [[#58](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/58)]
- fix(deps): update module golang.org/x/net to v0.42.0 [[#57](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/57)]
- chore(deps): update dependency go to v1.24.5 [[#56](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/56)]
- chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.3.0 [[#55](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/55)]
- fix(deps): update module github.com/urfave/cli/v3 to v3.3.8 [[#54](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/54)]
- fix(deps): update module golang.org/x/net to v0.41.0 [[#53](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/53)]
- chore(deps): update dependency go to v1.24.4 [[#52](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/52)]
- chore(deps): update dependency go to v1.24.3 [[#50](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/50)]
## [1.0.0](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v1.0.0) - 2025-04-24
### ❤️ Thanks to all contributors! ❤️
@woodpecker-bot, @xoxys
### 💥 Breaking changes
- Bump urfave/cli to v3.2.0 [[#49](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/49)]
### ✨ Features
- feat: add custom cli flags [[#48](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/48)]
### 📦️ Dependency
- fix(deps): update module github.com/urfave/cli/v3 to v3.1.1 [[#47](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/47)]
- chore(deps): update dependency go to v1.24.2 [[#46](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/46)]
- chore(deps): update golangci/golangci-lint docker tag to v2 [[#44](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/44)]
## [0.7.1](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v0.7.1) - 2025-02-16
### ❤️ Thanks to all contributors! ❤️
@6543, @woodpecker-bot
### 📦️ Dependency
- chore(deps): update golangci/golangci-lint docker tag to v1.64 [[#42](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/42)]
- chore(deps): update golang docker tag to v1.24 [[#41](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/41)]
- fix(deps): update module golang.org/x/net to v0.35.0 [[#43](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/43)]
- chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3.1.3 [[#40](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/40)]
- chore(deps): update docker.io/woodpeckerci/plugin-ready-release-go docker tag to v3 [[#37](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/37)]
### Misc
- Bump min golan version to v1.20 [[#36](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/36)]
## [0.7.0](https://codeberg.org/woodpecker-plugins/go-plugin/releases/tag/v0.7.0) - 2024-11-13
### ❤️ Thanks to all contributors! ❤️
@6543, @woodpecker-bot
### 📈 Enhancement
- Add support for CI_PIPELINE_FILES [[#33](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/33)]
### 📦️ Dependency
- fix(deps): update github.com/urfave/cli/v3 digest to cd7d34a [[#32](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/32)]
### Misc
- Use ready-release-go plugin [[#34](https://codeberg.org/woodpecker-plugins/go-plugin/pulls/34)]
+41
View File
@@ -0,0 +1,41 @@
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./.git/*")
GO_PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
.PHONY: all
all: lint
vendor:
go mod tidy
go mod vendor
format: install-tools ## Format source code
@gofumpt -extra -w ${GOFILES_NOVENDOR}
formatcheck:
@([ -z "$(shell gofumpt -d $(GOFILES_NOVENDOR) | head)" ]) || (echo "Source is unformatted"; exit 1)
install-tools: ## Install development tools
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest ; \
fi ; \
hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install mvdan.cc/gofumpt@latest; \
fi ; \
.PHONY: clean
clean:
go clean -i ./...
.PHONY: lint
lint: install-tools ## Lint code
@echo "Running golangci-lint"
golangci-lint run
.PHONY: vet
vet:
@echo "Running go vet..."
@go vet $(GO_PACKAGES)
.PHONY: test
test:
go test -race -cover ./...
+35 -6
View File
@@ -9,12 +9,40 @@ HTTP client library.
## Builtin settings
| Settings Name | Environment variable | Default | Description |
| ------------- | -------------------- | ------- | ---------------------------------------------------------------------------- | ------------------------------------ |
| ------------- | -------------------- | ------- | ---------------------------------------------------------------------------- |
| `log_level` | - | `info` | Sets log level (`panic`, `fatal`, `error`, `warn`, `info`, `debug`, `trace`) |
| `skip_verify` | - | `false` | - | Skip verification of TLS certificate |
| `skip_verify` | - | `false` | Skip verification of TLS certificate |
| | `SOCKS_PROXY` | _none_ | SOCKS5 proxy to use for connections |
| | `SOCKS_PROXY_OFF` | _none_ | Do not use SOCKS5 proxy |
### Optional: HTTP proxy support
HTTP proxy support is **opt-in** and must be explicitly enabled by the plugin author via `EnableHTTPProxy: true` in `plugin.Options`. When enabled, the following settings become available:
| Settings Name | Environment variable | Default | Description |
| ------------- | -------------------- | ------- | ------------------------------------------------------ |
| `http_proxy` | `HTTP_PROXY` | _none_ | HTTP proxy URL for outgoing connections |
| `https_proxy` | `HTTPS_PROXY` | _none_ | HTTPS proxy URL for outgoing connections |
| `no_proxy` | `NO_PROXY` | _none_ | Comma-separated list of hosts to exclude from proxying |
The settings are resolved in the following order of precedence:
1. **Plugin settings**`PLUGIN_HTTP_PROXY`, `PLUGIN_HTTPS_PROXY`, `PLUGIN_NO_PROXY`
2. **Lowercase env vars**`http_proxy`, `https_proxy`, `no_proxy`
3. **Uppercase env vars**`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`
Example Woodpecker CI pipeline configuration:
```yaml
steps:
- name: my-plugin
image: my-plugin:latest
settings:
http_proxy: http://proxy.example.com:3128
https_proxy: http://proxy.example.com:3128
no_proxy: "localhost,internal.example.com"
```
## Creating plugin
```go
@@ -62,10 +90,11 @@ func main() {
}
p.Plugin = plugin.New(plugin.Options{
Name: "sample-plugin",
Description: "Sample plugin",
Flags: p.Flags(),
Execute: p.Execute,
Name: "sample-plugin",
Description: "Sample plugin",
Flags: p.Flags(),
Execute: p.Execute,
EnableHTTPProxy: true, // opt-in to HTTP proxy support
})
p.Run()
+84
View File
@@ -0,0 +1,84 @@
package cli
import (
"encoding/json"
"github.com/urfave/cli/v3"
)
// StringMapFlag is a flag type which supports JSON string maps.
type (
StringMapFlag = cli.FlagBase[map[string]string, StringMapConfig, StringMap]
)
// StringMapConfig defines the configuration for string map flags.
type StringMapConfig struct {
// Any config options can be added here if needed
}
// StringMap implements the Value and ValueCreator interfaces for string maps.
type StringMap struct {
destination *map[string]string
}
// Create implements the ValueCreator interface.
func (s StringMap) Create(v map[string]string, p *map[string]string, _ StringMapConfig) cli.Value {
*p = map[string]string{}
if v != nil {
*p = v
}
return &StringMap{
destination: p,
}
}
// ToString implements the ValueCreator interface.
func (s StringMap) ToString(v map[string]string) string {
if len(v) == 0 {
return ""
}
jsonBytes, err := json.Marshal(v)
if err != nil {
return ""
}
return string(jsonBytes)
}
// Set implements the flag.Value interface.
func (s *StringMap) Set(v string) error {
*s.destination = map[string]string{}
if v == "" {
return nil
}
err := json.Unmarshal([]byte(v), s.destination)
if err != nil {
(*s.destination)["*"] = v
}
return nil
}
// Get implements the flag.Value interface.
func (s *StringMap) Get() any {
return *s.destination
}
// String implements the flag.Value interface.
func (s *StringMap) String() string {
if s.destination == nil || len(*s.destination) == 0 {
return ""
}
jsonBytes, err := json.Marshal(*s.destination)
if err != nil {
return ""
}
return string(jsonBytes)
}
+221
View File
@@ -0,0 +1,221 @@
package cli
import (
"encoding/json"
"testing"
"github.com/stretchr/testify/assert"
)
func TestStringMapSet(t *testing.T) {
tests := []struct {
name string
input string
want map[string]string
}{
{
name: "empty string",
input: "",
want: map[string]string{},
},
{
name: "valid JSON",
input: `{"key1":"value1","key2":"value2"}`,
want: map[string]string{"key1": "value1", "key2": "value2"},
},
{
name: "single key-value",
input: `{"key":"value"}`,
want: map[string]string{"key": "value"},
},
{
name: "non-JSON string",
input: "not-json",
want: map[string]string{"*": "not-json"},
},
{
name: "empty JSON object",
input: "{}",
want: map[string]string{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var dest map[string]string
s := &StringMap{
destination: &dest,
}
err := s.Set(tt.input)
assert.NoError(t, err)
assert.Equal(t, tt.want, dest)
})
}
}
func TestStringMapString(t *testing.T) {
tests := []struct {
name string
input map[string]string
want string
}{
{
name: "empty map",
input: map[string]string{},
want: "",
},
{
name: "nil map",
input: nil,
want: "",
},
{
name: "single key-value",
input: map[string]string{"key": "value"},
want: `{"key":"value"}`,
},
{
name: "multiple key-values",
input: map[string]string{"key1": "value1", "key2": "value2"},
want: `{"key1":"value1","key2":"value2"}`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
s := &StringMap{
destination: &tt.input,
}
got := s.String()
if len(tt.input) > 1 {
var expected, actual map[string]string
_ = json.Unmarshal([]byte(tt.want), &expected)
_ = json.Unmarshal([]byte(got), &actual)
assert.EqualValues(t, expected, actual)
return
}
assert.Equal(t, tt.want, got)
})
}
}
func TestStringMapGet(t *testing.T) {
tests := []struct {
name string
want map[string]string
}{
{
name: "empty map",
want: map[string]string{},
},
{
name: "single key-value",
want: map[string]string{"key": "value"},
},
{
name: "multiple key-values",
want: map[string]string{"key1": "value1", "key2": "value2"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
s := &StringMap{
destination: &tt.want,
}
result := s.Get()
assert.Equal(t, tt.want, result)
})
}
}
func TestStringMapCreate(t *testing.T) {
tests := []struct {
name string
input map[string]string
want map[string]string
}{
{
name: "empty map",
input: nil,
want: map[string]string{},
},
{
name: "empty map",
input: map[string]string{},
want: map[string]string{},
},
{
name: "single key-value",
input: map[string]string{"key": "value"},
want: map[string]string{"key": "value"},
},
{
name: "multiple key-values",
input: map[string]string{"key1": "value1", "key2": "value2"},
want: map[string]string{"key1": "value1", "key2": "value2"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var dest map[string]string
s := StringMap{}
config := StringMapConfig{}
got := s.Create(tt.input, &dest, config)
assert.Equal(t, tt.want, dest)
assert.Equal(t, &dest, got.(*StringMap).destination)
})
}
}
func TestStringMapToString(t *testing.T) {
tests := []struct {
name string
input map[string]string
want string
}{
{
name: "empty map",
input: map[string]string{},
want: "",
},
{
name: "single key-value",
input: map[string]string{"key": "value"},
want: `{"key":"value"}`,
},
{
name: "multiple key-values",
input: map[string]string{"key1": "value1", "key2": "value2"},
want: `{"key1":"value1","key2":"value2"}`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
s := StringMap{}
got := s.ToString(tt.input)
if len(tt.input) > 1 {
var expected, actual map[string]string
_ = json.Unmarshal([]byte(tt.want), &expected)
_ = json.Unmarshal([]byte(got), &actual)
assert.EqualValues(t, expected, actual)
return
}
assert.Equal(t, tt.want, got)
})
}
}
+83
View File
@@ -0,0 +1,83 @@
package cli
import (
"fmt"
"strings"
"github.com/urfave/cli/v3"
)
// StringSliceFlag is a flag type which support comma separated values and escaping to not split at unwanted lines.
type (
StringSliceFlag = cli.FlagBase[[]string, StringSliceConfig, StringSlice]
)
// StringConfig defines the configuration for string flags.
type StringSliceConfig struct {
Delimiter string
EscapeString string
}
// StringSlice implements the Value and ValueCreator interfaces for string slices.
type StringSlice struct {
destination *[]string
delimiter string
escapeString string
}
// Create implements the ValueCreator interface.
func (s StringSlice) Create(v []string, p *[]string, c StringSliceConfig) cli.Value {
*p = v
return &StringSlice{
destination: p,
delimiter: c.Delimiter,
escapeString: c.EscapeString,
}
}
// ToString implements the ValueCreator interface.
func (s StringSlice) ToString(v []string) string {
if len(v) == 0 {
return ""
}
return fmt.Sprintf("%q", strings.Join(v, s.delimiter))
}
// Set implements the flag.Value interface.
func (s *StringSlice) Set(v string) error {
if v == "" {
*s.destination = []string{}
return nil
}
out := strings.Split(v, s.delimiter)
//nolint:mnd
for i := len(out) - 2; i >= 0; i-- {
if strings.HasSuffix(out[i], s.escapeString) {
out[i] = out[i][:len(out[i])-len(s.escapeString)] + s.delimiter + out[i+1]
out = append(out[:i+1], out[i+2:]...)
}
}
*s.destination = out
return nil
}
// Get implements the flag.Value interface.
func (s *StringSlice) Get() any {
return *s.destination
}
// String implements the flag.Value interface.
func (s *StringSlice) String() string {
if s.destination == nil || len(*s.destination) == 0 {
return ""
}
return strings.Join(*s.destination, s.delimiter)
}
+225
View File
@@ -0,0 +1,225 @@
package cli
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestStringSliceSet(t *testing.T) {
tests := []struct {
name string
input string
want []string
}{
{
name: "empty string",
input: "",
want: []string{},
},
{
name: "simple comma separated",
input: "a,b",
want: []string{"a", "b"},
},
{
name: "multiple commas",
input: ",,,",
want: []string{"", "", "", ""},
},
{
name: "escaped comma",
input: ",a\\,",
want: []string{"", "a,"},
},
{
name: "escaped backslash",
input: "a,b\\,c\\\\d,e",
want: []string{"a", "b,c\\\\d", "e"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var got []string
s := &StringSlice{
destination: &got,
delimiter: ",",
escapeString: "\\",
}
err := s.Set(tt.input)
assert.NoError(t, err)
assert.Equal(t, tt.want, got)
})
}
}
func TestStringSliceString(t *testing.T) {
tests := []struct {
name string
input []string
want string
}{
{
name: "empty slice",
input: []string{},
want: "",
},
{
name: "nil slice",
input: nil,
want: "",
},
{
name: "single item",
input: []string{"a"},
want: "a",
},
{
name: "multiple items",
input: []string{"a", "b", "c"},
want: "a,b,c",
},
{
name: "items with commas",
input: []string{"a,b", "c"},
want: "a,b,c",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
s := &StringSlice{
destination: &tt.input,
delimiter: ",",
escapeString: "\\",
}
assert.Equal(t, tt.want, s.String())
})
}
}
func TestStringSliceGet(t *testing.T) {
tests := []struct {
name string
want []string
}{
{
name: "empty slice",
want: []string{},
},
{
name: "single item",
want: []string{"a"},
},
{
name: "multiple items",
want: []string{"a", "b", "c"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
s := &StringSlice{
destination: &tt.want,
delimiter: ",",
escapeString: "\\",
}
result := s.Get()
assert.Equal(t, tt.want, result)
})
}
}
func TestStringSliceCreate(t *testing.T) {
tests := []struct {
name string
input []string
want []string
config StringSliceConfig
}{
{
name: "empty slice",
input: nil,
want: []string{},
},
{
name: "default config",
input: []string{"a", "b"},
want: []string{"a", "b"},
config: StringSliceConfig{
Delimiter: ",",
EscapeString: "\\",
},
},
{
name: "custom config",
input: []string{"a", "b"},
want: []string{"a", "b"},
config: StringSliceConfig{
Delimiter: ";",
EscapeString: "#",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var dest []string
s := StringSlice{}
got := s.Create(tt.input, &dest, tt.config)
assert.Equal(t, tt.input, dest)
assert.Equal(t, &dest, got.(*StringSlice).destination)
assert.Equal(t, tt.config.Delimiter, got.(*StringSlice).delimiter)
assert.Equal(t, tt.config.EscapeString, got.(*StringSlice).escapeString)
})
}
}
func TestStringSliceToString(t *testing.T) {
tests := []struct {
name string
input []string
delimiter string
want string
}{
{
name: "empty slice",
input: []string{},
delimiter: ",",
want: "",
},
{
name: "single item",
input: []string{"a"},
delimiter: ",",
want: `"a"`,
},
{
name: "multiple items",
input: []string{"a", "b", "c"},
delimiter: ",",
want: `"a,b,c"`,
},
{
name: "custom delimiter",
input: []string{"a", "b", "c"},
delimiter: ";",
want: `"a;b;c"`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
s := StringSlice{delimiter: tt.delimiter}
got := s.ToString(tt.input)
assert.Equal(t, tt.want, got)
})
}
}
+10 -8
View File
@@ -1,20 +1,22 @@
module codeberg.org/woodpecker-plugins/go-plugin
go 1.19
go 1.25.0
toolchain go1.26.4
require (
github.com/joho/godotenv v1.5.1
github.com/rs/zerolog v1.33.0
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v3 v3.0.0-alpha9.0.20240717192922-127cf54fac9f
golang.org/x/net v0.27.0
github.com/rs/zerolog v1.35.1
github.com/stretchr/testify v1.11.1
github.com/urfave/cli/v3 v3.10.0
golang.org/x/net v0.56.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/sys v0.46.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+14 -21
View File
@@ -1,31 +1,24 @@
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/urfave/cli/v3 v3.0.0-alpha9.0.20240717192922-127cf54fac9f h1:yCJ90PBe7+45EQSF3qJXyAGW5rkE65lE8huv5pM0HY8=
github.com/urfave/cli/v3 v3.0.0-alpha9.0.20240717192922-127cf54fac9f/go.mod h1:Z1ItyMma7t6I7zHG9OpbExhHQOSkFf/96n+mAZ9MtVI=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
github.com/rs/zerolog v1.35.1 h1:m7xQeoiLIiV0BCEY4Hs+j2NG4Gp2o2KPKmhnnLiazKI=
github.com/rs/zerolog v1.35.1/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/urfave/cli/v3 v3.10.0 h1:0aU8yOObVDMkM13Cj4G+zb4P0PdeJMec65f81Ak1ioM=
github.com/urfave/cli/v3 v3.10.0/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso=
golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o=
golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+48 -1
View File
@@ -20,6 +20,7 @@ import (
"crypto/x509"
"net"
"net/http"
"os"
"time"
"github.com/rs/zerolog/log"
@@ -55,13 +56,59 @@ func httpClientFlags() []cli.Flag {
}
}
func HTTPClientFromContext(c *cli.Command) *http.Client {
// httpProxyFlags returns the optional HTTP proxy flags.
// Only added to the app when EnableHTTPProxy is set in Options.
func httpProxyFlags() []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "transport.http-proxy",
Usage: "HTTP proxy URL",
Sources: cli.EnvVars(
"PLUGIN_HTTP_PROXY",
),
Hidden: true,
},
&cli.StringFlag{
Name: "transport.https-proxy",
Usage: "HTTPS proxy URL",
Sources: cli.EnvVars(
"PLUGIN_HTTPS_PROXY",
),
Hidden: true,
},
&cli.StringFlag{
Name: "transport.no-proxy",
Usage: "Hosts to exclude from proxy (comma-separated)",
Sources: cli.EnvVars(
"PLUGIN_NO_PROXY",
),
Hidden: true,
},
}
}
func HTTPClientFromContext(c *cli.Command, httpProxyEnabled bool) *http.Client {
var (
skip = c.Bool("transport.skip-verify")
socks = c.String("transport.socks-proxy")
socksOff = c.Bool("transport.socks-proxy-off")
)
if httpProxyEnabled {
if v := c.String("transport.http-proxy"); v != "" {
os.Setenv("HTTP_PROXY", v)
os.Setenv("http_proxy", v)
}
if v := c.String("transport.https-proxy"); v != "" {
os.Setenv("HTTPS_PROXY", v)
os.Setenv("https_proxy", v)
}
if v := c.String("transport.no-proxy"); v != "" {
os.Setenv("NO_PROXY", v)
os.Setenv("no_proxy", v)
}
}
certs, err := x509.SystemCertPool()
if err != nil {
log.Error().Err(err).Msg("failed to find system CA certs")
+5 -5
View File
@@ -16,7 +16,6 @@ package plugin
import (
"context"
"os"
"testing"
"time"
@@ -53,6 +52,7 @@ func testMetadata() map[string]string {
"CI_PIPELINE_STATUS": "running",
"CI_PIPELINE_CREATED": "1611234567",
"CI_PIPELINE_STARTED": "1611234567",
"CI_PIPELINE_FILES": `["README.md", "main.go"]`,
// Step
"CI_STEP_NUMBER": "1",
"CI_STEP_NAME": "test",
@@ -71,15 +71,14 @@ func testMetadata() map[string]string {
func TestMetadata(t *testing.T) {
for k, v := range testMetadata() {
os.Setenv(k, v)
defer os.Unsetenv(k)
t.Setenv(k, v)
}
plugin := New(Options{
Execute: func(ctx context.Context) error {
Execute: func(_ context.Context) error {
return nil
},
})
err := plugin.app.Run(plugin.ctx, []string{"test"})
err := plugin.App.Run(plugin.ctx, []string{"test"})
require.NoError(t, err)
// Repository
@@ -107,6 +106,7 @@ func TestMetadata(t *testing.T) {
assert.Equal(t, "running", plugin.Metadata.Pipeline.Status)
assert.Equal(t, time.Unix(1611234567, 0), plugin.Metadata.Pipeline.Created)
assert.Equal(t, time.Unix(1611234567, 0), plugin.Metadata.Pipeline.Started)
assert.Equal(t, []string{"README.md", "main.go"}, plugin.Metadata.Pipeline.ChangedFiles)
// Step
assert.Equal(t, 1, plugin.Metadata.Step.Number)
+31 -10
View File
@@ -15,8 +15,11 @@
package plugin
import (
"encoding/json"
"os"
"time"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v3"
)
@@ -40,6 +43,7 @@ type Pipeline struct {
Started time.Time `json:"started,omitempty"`
Finished time.Time `json:"finished,omitempty"`
Parent int64 `json:"parent,omitempty"`
ChangedFiles []string `json:"files,omitempty"`
// Deprecated: Please use URL instead.
Link string `json:"link,omitempty"`
@@ -47,7 +51,7 @@ type Pipeline struct {
func pipelineFlags() []cli.Flag {
return []cli.Flag{
&cli.IntFlag{
&cli.Int64Flag{
Name: "pipeline.number",
Usage: "pipeline number",
Sources: cli.EnvVars(
@@ -89,7 +93,7 @@ func pipelineFlags() []cli.Flag {
"DRONE_DEPLOY_TO",
),
},
&cli.IntFlag{
&cli.Int64Flag{
Name: "pipeline.created",
Usage: "pipeline creation time",
Sources: cli.EnvVars(
@@ -97,7 +101,7 @@ func pipelineFlags() []cli.Flag {
"DRONE_BUILD_CREATED",
),
},
&cli.IntFlag{
&cli.Int64Flag{
Name: "pipeline.started",
Usage: "pipeline start time",
Sources: cli.EnvVars(
@@ -105,7 +109,7 @@ func pipelineFlags() []cli.Flag {
"DRONE_BUILD_STARTED",
),
},
&cli.IntFlag{
&cli.Int64Flag{
Name: "pipeline.finished",
Usage: "pipeline finish time",
Sources: cli.EnvVars(
@@ -113,7 +117,7 @@ func pipelineFlags() []cli.Flag {
"DRONE_BUILD_FINISHED",
),
},
&cli.IntFlag{
&cli.Int64Flag{
Name: "pipeline.parent",
Usage: "pipeline parent",
Sources: cli.EnvVars(
@@ -121,20 +125,37 @@ func pipelineFlags() []cli.Flag {
"DRONE_BUILD_PARENT",
),
},
&cli.StringFlag{
Name: "pipeline.files",
Usage: "pipeline changed files (string list as json)",
Sources: cli.EnvVars(
"CI_PIPELINE_FILES",
),
},
}
}
func pipelineFromContext(c *cli.Command) Pipeline {
var changedFiles []string
if files := c.String("pipeline.files"); files != "" {
if err := json.Unmarshal([]byte(files), &changedFiles); err != nil {
log.Error().Err(err).Msg("parse \"CI_PIPELINE_FILES\" failed")
os.Exit(1)
}
}
return Pipeline{
Number: c.Int("pipeline.number"),
Number: c.Int64("pipeline.number"),
Status: c.String("pipeline.status"),
Event: c.String("pipeline.event"),
URL: c.String("pipeline.url"),
Link: c.String("pipeline.url"),
DeployTarget: c.String("pipeline.deploy-target"),
Created: time.Unix(c.Int("pipeline.created"), 0),
Started: time.Unix(c.Int("pipeline.started"), 0),
Finished: time.Unix(c.Int("pipeline.finished"), 0),
Parent: c.Int("pipeline.parent"),
Created: time.Unix(c.Int64("pipeline.created"), 0),
Started: time.Unix(c.Int64("pipeline.started"), 0),
Finished: time.Unix(c.Int64("pipeline.finished"), 0),
Parent: c.Int64("pipeline.parent"),
ChangedFiles: changedFiles,
}
}
+19 -7
View File
@@ -38,14 +38,20 @@ type Options struct {
Execute ExecuteFunc
// Context the plugin will use while executing.
Context context.Context
// EnableHTTPProxy allows plugins to opt-in to HTTP/HTTPS proxy support.
// When true, PLUGIN_HTTP_PROXY, PLUGIN_HTTPS_PROXY and PLUGIN_NO_PROXY
// are accepted as settings and applied to the HTTP client.
EnableHTTPProxy bool
}
// Plugin defines the plugin instance.
type Plugin struct {
app *cli.Command
App *cli.Command
execute ExecuteFunc
client *http.Client
ctx context.Context
// enableHTTPProxy controls whether HTTP proxy flags are registered and applied.
enableHTTPProxy bool
// Metadata of the current pipeline.
Metadata Metadata
}
@@ -68,11 +74,17 @@ func New(opt Options) *Plugin {
}
plugin := &Plugin{
app: app,
execute: opt.Execute,
ctx: opt.Context,
App: app,
execute: opt.Execute,
ctx: opt.Context,
enableHTTPProxy: opt.EnableHTTPProxy,
}
plugin.app.Action = plugin.action
if opt.EnableHTTPProxy {
app.Flags = append(app.Flags, httpProxyFlags()...)
}
plugin.App.Action = plugin.action
if plugin.ctx == nil {
plugin.ctx = context.Background()
@@ -87,7 +99,7 @@ func (p *Plugin) action(ctx context.Context, c *cli.Command) error {
}
p.Metadata = MetadataFromContext(c)
p.client = HTTPClientFromContext(c)
p.client = HTTPClientFromContext(c, p.enableHTTPProxy)
if p.execute == nil {
panic("plugin execute function is not set")
@@ -103,7 +115,7 @@ func (p *Plugin) HTTPClient() *http.Client {
// Run the plugin.
func (p *Plugin) Run() {
if err := p.app.Run(p.ctx, os.Args); err != nil {
if err := p.App.Run(p.ctx, os.Args); err != nil {
log.Error().Err(err).Msg("execution failed")
os.Exit(1)
}
+2 -2
View File
@@ -25,12 +25,12 @@ func TestPlugin(t *testing.T) {
var executed bool
p := New(Options{
Name: "test",
Execute: func(ctx context.Context) error {
Execute: func(_ context.Context) error {
executed = true
return nil
},
})
err := p.app.Run(p.ctx, []string{"test"})
err := p.App.Run(p.ctx, []string{"test"})
assert.NoError(t, err)
assert.True(t, executed)
}
+34 -5
View File
@@ -22,13 +22,40 @@ import (
// Step defines runtime metadata for a step.
type Step struct {
Name string `json:"name,omitempty"`
Type StepType `json:"type,omitempty"`
Number int `json:"number,omitempty"`
Started time.Time `json:"started,omitempty"`
Finished time.Time `json:"finished,omitempty"`
}
// StepType identifies the type of step.
type StepType string
const (
StepTypeClone StepType = "clone"
StepTypeService StepType = "service"
StepTypePlugin StepType = "plugin"
StepTypeCommands StepType = "commands"
StepTypeCache StepType = "cache"
)
func stepFlags() []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "step.name",
Usage: "step name",
Sources: cli.EnvVars(
"CI_STEP_NAME",
),
},
&cli.StringFlag{
Name: "step.type",
Usage: "step type",
Sources: cli.EnvVars(
"CI_STEP_TYPE",
),
},
&cli.IntFlag{
Name: "step.number",
Usage: "step number",
@@ -37,14 +64,14 @@ func stepFlags() []cli.Flag {
"DRONE_STEP_NUMBER",
),
},
&cli.IntFlag{
&cli.Int64Flag{
Name: "step.started",
Usage: "step start time",
Sources: cli.EnvVars(
"CI_STEP_STARTED",
),
},
&cli.IntFlag{
&cli.Int64Flag{
Name: "step.finished",
Usage: "step finish time",
Sources: cli.EnvVars(
@@ -56,8 +83,10 @@ func stepFlags() []cli.Flag {
func stepFromContext(c *cli.Command) Step {
return Step{
Number: int(c.Int("step.number")),
Started: time.Unix(c.Int("step.started"), 0),
Finished: time.Unix(c.Int("step.finished"), 0),
Name: c.String("step.name"),
Type: StepType(c.String("step.type")),
Number: c.Int("step.number"),
Started: time.Unix(c.Int64("step.started"), 0),
Finished: time.Unix(c.Int64("step.finished"), 0),
}
}