Open rubenelshof opened 1 year ago
I think the issue is that those value are set by the agent when the step is started, but the values you are using are evaluated when parsing the config.
I dont think I quite get what you mean. Could you elaborate?
There are different "stages" in which the variable placeholder you define are replaced. The one you are trying to use here is not set at that stage. Its set as env var inside your container, but not before. Maybe we can improve this somehow, but currently I have no concrete idea
I see. Reason I thought I could use it this way was this issue #1681 & follow up PR. Additionally because the variables are on this list I thought they would be available.
I will just use the workflow name for now.
For me, CI_STEP_NAME
shows something like wp_s6vj82zh9s2h8b33opzqk45sut7_0_step_3
instead of the name (e.g. build
).
I am unsure whether that is the same problem or not? (Because for me it is not blank.) I am using that env var with a different plugin though.
I'm experiencing the same issue as @lonix1: Some kind of autogenerated name is used, even if a name is set in the woodpecker.yml file. However, I'm observing this behavior with regular steps (i.e. not using a plugin). Definitely sounds like a bug to me.
{"source":"https://github.com/woodpecker-ci/woodpecker","version":"1.0.1"}
The affected steps are being executed on a docker agent.
Reproduced this behavior on v2.5.0. There's empty CI_STEP_NAME
, CI_STEP_NUMBER
always equals zero, no CI_STEP_URL
following to the current step (the link is directing to the whole pipeline) and step with failure: ignore
setting is reported as success
.
Workflow:
when:
- event: push
branch: main
steps:
failing-step:
image: alpine
commands:
- printenv
- exit 1
failure: ignore
after-fail:
image: alpine
commands:
- printenv
Output for failing
:
+ printenv
...
CI_STEP_FINISHED=1718965573
CI_STEP_NAME=
CI_STEP_NUMBER=0
CI_STEP_STARTED=1718965571
CI_STEP_STATUS=success
CI_STEP_URL=https://ci.example.com/repos/1/pipeline/25
...
Output for after-fail
step:
+ printenv
...
CI_STEP_FINISHED=1718965578
CI_STEP_NAME=
CI_STEP_NUMBER=0
CI_STEP_STARTED=1718965571
CI_STEP_STATUS=success
CI_STEP_URL=https://ci.example.com/repos/1/pipeline/25
...
There's another kind of question: as I can understand some variables (CI_STEP_STARTED
, CI_STEP_FINISHED
) belong to the previous step, but in documentation it is described as variables for the current step.
Component
server
Describe the bug
While testing the ntfy plugin to send notifications after pipeline failure I wanted to use
CI_STEP_NAME
but it doesn't return a value. The other CISTEP* variables are not returning anything either.Here a example pipeline. I have added
CI_WORKFLOW_NAME
which does work.System Info
Additional context
No response
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]