You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-23 21:44:44 +02:00
Replace DRONE_ with CI_ variables in pipeline steps (#427)
Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables. - `CI_*` prefix replaces `DRONE_*` - `CI` value is now `woodpecker` - `DRONE=true` has been removed
This commit is contained in:
@@ -2,6 +2,7 @@ package pipeline
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -127,6 +128,13 @@ func (r *Runtime) exec(proc *backend.Step) error {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: using DRONE_ will be deprecated with 0.15.0. remove fallback with following release
|
||||
for key, value := range proc.Environment {
|
||||
if strings.HasPrefix(key, "CI_") {
|
||||
proc.Environment[strings.Replace(key, "CI_", "DRONE_", 1)] = value
|
||||
}
|
||||
}
|
||||
|
||||
if err := r.engine.Exec(r.ctx, proc); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user