Woodpecker CI plugin library
Go to file
woodpecker-bot ab2091b8bc Update module github.com/joho/godotenv to v1.5.1 (#11)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/joho/godotenv](https://github.com/joho/godotenv) | require | minor | `v1.4.0` -> `v1.5.1` |

---

### Release Notes

<details>
<summary>joho/godotenv (github.com/joho/godotenv)</summary>

### [`v1.5.1`](https://github.com/joho/godotenv/releases/tag/v1.5.1): Fix parser regressions from multiline support

[Compare Source](https://github.com/joho/godotenv/compare/v1.5.0...v1.5.1)

Version 1.5 came with a whole new parser, and with a new parser comes new bugs.

Things that were broken in 1.5 that are now fixed:

-   unquoted variables with interior whitespace no longer split on the first space (and then break the following line if you have one)
-   inline comments now work again for both quoted and unquoted variables
-   ` export  ` statement filtering was made more robust and matched earlier versions behaviour
-   `FOO.BAR` key names are permitted again (i have no idea why you'd do it, but it's explicitly supported in ruby dotenv files)

There's one breaking change: earlier versions of this library would allow unterminated quoted variables in some instances and return a value (ie `FOO="bar` would set env of `FOO: '"bar'`), this now returns an error.

#### What's Changed

-   Fix bug where internal unquoted whitespace truncates values by [@&#8203;joho](https://github.com/joho) in https://github.com/joho/godotenv/pull/205

**Full Changelog**: https://github.com/joho/godotenv/compare/v1.5.0...v1.5.1

### [`v1.5.0`](https://github.com/joho/godotenv/releases/tag/v1.5.0): - multiline variables

[Compare Source](https://github.com/joho/godotenv/compare/v1.4.0...v1.5.0)

The big news this release is that godotenv finally, after much procrastination in review, supports multiline variables (fixes [#&#8203;64](https://github.com/joho/godotenv/issues/64)). Big shoutout to [@&#8203;x1unix](https://github.com/x1unix) for the bulk of the work on the original PR and also to [@&#8203;coolaj86](https://github.com/coolaj86) and [@&#8203;austinsasko](https://github.com/austinsasko) for some very helpful review and tweaks.

Also added a `-o` overload flag (thanks [@&#8203;2tef](https://github.com/2tef))

#### What's Changed

-   Try and fix go get in CI for power8 by [@&#8203;joho](https://github.com/joho) in https://github.com/joho/godotenv/pull/157
-   Fix typos in comments and extend README by [@&#8203;alexandear](https://github.com/alexandear) in https://github.com/joho/godotenv/pull/177
-   tune README by [@&#8203;bikbah](https://github.com/bikbah) in https://github.com/joho/godotenv/pull/170
-   Remove renovate, add dependabot by [@&#8203;joho](https://github.com/joho) in https://github.com/joho/godotenv/pull/183
-   Setup codeql by [@&#8203;joho](https://github.com/joho) in https://github.com/joho/godotenv/pull/186
-   Bump actions/checkout from 2 to 3 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/joho/godotenv/pull/184
-   Bump actions/setup-go from 2 to 3 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/joho/godotenv/pull/185
-   Add darwin arm64 build by [@&#8203;statik](https://github.com/statik) in https://github.com/joho/godotenv/pull/174
-   Sort Go import in README by [@&#8203;Doarakko](https://github.com/Doarakko) in https://github.com/joho/godotenv/pull/193
-   Fix godoc formatting by [@&#8203;joho](https://github.com/joho) in https://github.com/joho/godotenv/pull/197
-   fix tiny details by [@&#8203;2tef](https://github.com/2tef) in https://github.com/joho/godotenv/pull/199
-   Multiline string support by [@&#8203;x1unix](https://github.com/x1unix) in https://github.com/joho/godotenv/pull/156
-   Update CI to test go 1.20 by [@&#8203;joho](https://github.com/joho) in https://github.com/joho/godotenv/pull/201
-   fix whitespace with gofmt by [@&#8203;2tef](https://github.com/2tef) in https://github.com/joho/godotenv/pull/203
-   add overload flag by [@&#8203;2tef](https://github.com/2tef) in https://github.com/joho/godotenv/pull/200
-   -   Fix: ioutil.ReadAll() is deprecated, so removed it's dependency by [@&#8203;dreygur](https://github.com/dreygur) in https://github.com/joho/godotenv/pull/202

#### New Contributors

-   [@&#8203;x1unix](https://github.com/x1unix) made their first contribution in https://github.com/joho/godotenv/pull/118
-   [@&#8203;alexandear](https://github.com/alexandear) made their first contribution in https://github.com/joho/godotenv/pull/177
-   [@&#8203;bikbah](https://github.com/bikbah) made their first contribution in https://github.com/joho/godotenv/pull/170
-   [@&#8203;dependabot](https://github.com/dependabot) made their first contribution in https://github.com/joho/godotenv/pull/184
-   [@&#8203;statik](https://github.com/statik) made their first contribution in https://github.com/joho/godotenv/pull/174
-   [@&#8203;Doarakko](https://github.com/Doarakko) made their first contribution in https://github.com/joho/godotenv/pull/193
-   [@&#8203;2tef](https://github.com/2tef) made their first contribution in https://github.com/joho/godotenv/pull/199
-   [@&#8203;dreygur](https://github.com/dreygur) made their first contribution in https://github.com/joho/godotenv/pull/202

**Full Changelog**: https://github.com/joho/godotenv/compare/v1.4.0...v1.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - "before 4am" (UTC).

🚦 **Automerge**: Enabled.

♻ **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:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMi4wIiwidXBkYXRlZEluVmVyIjoiMzcuMzMuNiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/11
Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de>
Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de>
2023-10-27 12:27:44 +00:00
.woodpecker.yaml Update golang Docker tag to v1.21 (#9) 2023-10-27 12:27:37 +00:00
commit.go Initial implementation 2023-01-08 04:53:03 +02:00
flags.go Initial implementation 2023-01-08 04:53:03 +02:00
go.mod Update module github.com/joho/godotenv to v1.5.1 (#11) 2023-10-27 12:27:44 +00:00
go.sum Update module github.com/joho/godotenv to v1.5.1 (#11) 2023-10-27 12:27:44 +00:00
http.go Initial implementation 2023-01-08 04:53:03 +02:00
LICENSE Initial implementation 2023-01-08 04:53:03 +02:00
logger.go Fix to not log time in output (#3) 2023-01-09 12:33:18 +00:00
metadata_test.go Initial implementation 2023-01-08 04:53:03 +02:00
metadata.go Initial implementation 2023-01-08 04:53:03 +02:00
pipeline.go Initial implementation 2023-01-08 04:53:03 +02:00
plugin_test.go Initial implementation 2023-01-08 04:53:03 +02:00
plugin.go Initial implementation 2023-01-08 04:53:03 +02:00
README.md Initial implementation 2023-01-08 04:53:03 +02:00
renovate.json Configure Renovate (#4) 2023-10-16 16:52:34 +00:00
repo.go Initial implementation 2023-01-08 04:53:03 +02:00
step.go Initial implementation 2023-01-08 04:53:03 +02:00
system.go Initial implementation 2023-01-08 04:53:03 +02:00

Library for creating Woodpecker CI plugins

Provides basic structure and helpers to load Woodpecker CI environment variables while also supporting reading Drone CI environment variables where available.

Adds logging support based on zerolog library and allows configurable 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 -
SOCKS_PROXY none SOCKS5 proxy to use for connections
SOCKS_PROXY_OFF none Do not use SOCKS5 proxy

Creating plugin

import (
    "context"

    "codeberg.org/woodpecker-plugins/go-plugin"
    "github.com/urfave/cli/v2"
    "github.com/rs/zerolog/log"
)

type Settings struct {
    // TODO: Plugin settings
    SampleFlag string
}

type Plugin struct {
    *plugin.Plugin
    Settings *Settings
}

func (p *Plugin) Flags() []cli.Flag {
    return []cli.Flag{
        // TODO: Add flags
        &cli.StringFlag{
            Name:    "sample.flag",
            Usage:   "sample flag",
            EnvVars: []string{"PLUGIN_SAMPLE_FLAG"},
            Destination: &p.Settings.SampleFlag,
        },
    }
}

func (p *Plugin) Execute(ctx context.Context) error {
    // TODO: Implement execution
    log.Debug().Msg("executed")
    return nil
}

func main() {
    p := &Plugin{
        &Settings{}
    }
    
    p.Plugin = plugin.New(Options{
        Name: "sample-plugin",
        Description: "Sample plugin",
        Flags: p.Flags(),
        Execute: p.Execute,
    })

    p.Run()
}