Different Job Secret for Different Branch not working (OD-1959)
Vyom opened 2 years ago

I'm trying to use secret with same name and different branch condition. But it seems to not work as expected.

Ci/cd commands:

Screenshot 2024-06-19 123000.png

Secret created:

Screenshot 2024-06-19 123042.png

  • Robin Shen commented 2 years ago

    If the commit can be reached from dev, the first value will be used; If the commit can be reached from stage, the second value will be used; If the commit can not be reached from eitherdev or stage, the build will fail with an unauthorized secret error.

  • Vyom commented 2 years ago

    My code cycle is like dev -> stage -> main. My code gets merged from dev to stage to main.

    As per your explanation, which commit are you referring to when i merge from dev to stage.

    Also, can you help me with where i'm going wrong as per my strategy for merging code and I want it to work as simple as that. If the pipeline is triggered from dev branch it should consider secret value as test:dev. When code is merged from dev branch to stage branch, the pipeline is triggered from stage and it should consider secret value as test:stage.

    Thank You

  • Robin Shen commented 2 years ago

    So you want that secret test:dev is used for jobs triggered by open pull request from dev to stage, and secret test:stage is used for jobs triggered by pull request merge from dev to stage?

  • Robin Shen changed state to 'Closed' 2 years ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-1959
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover