Drone

Secret empty on PR, but ok on branch and after merge

I have a strange issue with secrets and pull requests. The secret is available on a branch, but not on a pull request from the same branch (secret empty). After having merged the pull request the secret is available again on the target branch. I have read Problems with Secrets but the problem remains.

Using latest docker drone.io in a docker pipeline.

---
kind: pipeline
type: docker
name: default

steps:
- name: hello
  image: debian:buster
  commands:
  - echo $${SECRET}
  environment:
      SECRET:
          from_secret: secret

On the branch:

+ echo ${SECRET}
********

On the PR:

+ echo ${SECRET}

After the merge:

+ echo ${SECRET}
********

I have exactly the same behavior with $SECRET instead of $${SECRET} in .drone.yml
The secret has been created at repo level through the web-ui.

Just found Empty secret when build for Pull Request

Will install drone cli and try to configure the secret for PR.

In fact the doc https://docs.drone.io/configure/secrets/repository/ is pretty clear about secrets and pull requests. Sorry for the noise !