Backport #1616Close#1615
The error described in
https://github.com/woodpecker-ci/woodpecker/issues/1615 is happening
because `Tail` method of the docker backend closes the instance of
`io.ReadCloser` it returns in `defer` function. As a result anything
that try to read data returned by `Tail` method eventually will attempt
to read from closes reader and get an error:
2171212c5a/pipeline/backend/docker/docker.go (L229)
The fix is just don't close returned reader and let the consumer of
`Tail` method do it. Good thing is that `Tail` is used only in one place
and reader is correctly closed:
2171212c5a/pipeline/pipeline.go (L231-L237)
Example of `woodpecker exec` output using pipeline from
https://github.com/woodpecker-ci/woodpecker/issues/1615 with the fix:
```
woodpecker exec .woodpecker.yaml
[step1:L0:0s] + echo step1
[step1:L1:0s] step1
[step2:L0:0s] + echo step2
[step2:L1:0s] step2
```
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
This is a follow up on #1379 and #1381, after fixing those (I noticed
them while building a pipeline for one of my projects) I took a deep
dive into the schema, and consolidated the functionality as far as
possible.
As a reference, I matched it against
pipeline/frontend/yaml/constraint//constraints.go of the release/v0.15
branch.
The .branches while not in the pipeline uses the Type (List) and
functions of pipeline/frontend/yaml/constraint//constraints.go
Regarding the formatting i went with what was already there, since
enabling editorconfig / formatting would have changed most of the file
(not that there is too much untouched after this anyways)
Previously the schema only accepted string, this fixes#1379 and matches
the linter to the existing capabilities of the constraints.go (and
therefore server).
Secret names where matched based on their lowercase value already just the conversion to lowercase for `from_secrets` was missing.
Co-authored-by: Anbraten <anton@ju60.de>
* Allow users not logged in to access branches page
(fixes a nil pointer derefernce)
* Add Gogs support for branches
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>