Compare commits

..

15 Commits

Author SHA1 Message Date
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
7 changed files with 67 additions and 11 deletions
+2 -2
View File
@@ -6,8 +6,8 @@ when:
- 'renovate/*'
variables:
- &golang "golang:1.22"
- &golangci-lint "golangci/golangci-lint:v1.59-alpine"
- &golang "golang:1.23"
- &golangci-lint "golangci/golangci-lint:v1.61-alpine"
- &reviewdog-golangci-lint "woodpeckerci/plugin-reviewdog-golangci-lint:1.59"
steps:
+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:2.1.1
settings:
release_branch: ${CI_COMMIT_BRANCH}
git_email: woodpecker-bot@obermui.de
forge_token:
from_secret: gitea_token
+19
View File
@@ -0,0 +1,19 @@
# Changelog
## [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)]
+3 -3
View File
@@ -6,8 +6,8 @@ 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/urfave/cli/v3 v3.0.0-alpha9.1
golang.org/x/net v0.30.0
)
require (
@@ -15,6 +15,6 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/sys v0.26.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+6 -6
View File
@@ -17,15 +17,15 @@ 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=
github.com/urfave/cli/v3 v3.0.0-alpha9.1 h1:1fJU+bltkwN8lF4Sni/X0i1d8XwPIrS82ivZ8qsp/q4=
github.com/urfave/cli/v3 v3.0.0-alpha9.1/go.mod h1:FnIeEMYu+ko8zP1F9Ypr3xkZMIDqW3DR92yUtY39q1Y=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
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=
+2
View File
@@ -53,6 +53,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",
@@ -107,6 +108,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)
+21
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"`
@@ -121,10 +125,26 @@ 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"),
Status: c.String("pipeline.status"),
@@ -136,5 +156,6 @@ func pipelineFromContext(c *cli.Command) Pipeline {
Started: time.Unix(c.Int("pipeline.started"), 0),
Finished: time.Unix(c.Int("pipeline.finished"), 0),
Parent: c.Int("pipeline.parent"),
ChangedFiles: changedFiles,
}
}