Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Woodpecker UI isn't showing secrets's names with uppercase. #2368

Closed
5 tasks done
GamePlayer-8 opened this issue Sep 4, 2023 · 10 comments · Fixed by #3375
Closed
5 tasks done

Woodpecker UI isn't showing secrets's names with uppercase. #2368

GamePlayer-8 opened this issue Sep 4, 2023 · 10 comments · Fixed by #3375
Labels
bug Something isn't working

Comments

@GamePlayer-8
Copy link

Component

web-ui

Describe the bug

Writing secrets with uppercase i.e. OCI_TOKEN is being interpreted as oci_token for the web UI although it stays as OCI_TOKEN in the workflow.

System Info

`{"source":"https://github.com/woodpecker-ci/woodpecker","version":"next-5bd12aa646"}`

Additional context

Might be related to #2084

Validations

  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Checked that the bug isn't fixed in the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
  • Check that this is a concrete bug. For Q&A join our Discord Chat Server or the Matrix room.
@GamePlayer-8 GamePlayer-8 added the bug Something isn't working label Sep 4, 2023
@anbraten
Copy link
Member

anbraten commented Sep 4, 2023

Woodpecker internally converts all secrets to lower case: https://github.com/search?q=repo%3Awoodpecker-ci%2Fwoodpecker%20.ToLower&type=code

I think the corresponding env var if secrets: is supplied is uppercase

@GamePlayer-8
Copy link
Author

the problem is that it's not converting uppercase env variable into lowercase for the workflow then.

@qwerty287
Copy link
Contributor

qwerty287 commented Sep 17, 2023

@GamePlayer-8 I don't really understand what you mean. Secret env vars are and should be uppercase, no matter the secret name.

@GamePlayer-8
Copy link
Author

Secret isn't displayed as uppercase in the UI of woodpecker after adding it, even if I type it all with uppercase.

@qwerty287
Copy link
Contributor

That's also intentional because all secret names are converted to lowercase. However, in workflow yamls you should be able to use them case-insensitive.

@GamePlayer-8
Copy link
Author

I've tried to call the lowercase & I got no data while with uppercase I've got the secret. Shouldn't the environment variable inside the workflow be converted to lowercase to avoid confusion?

@qwerty287
Copy link
Contributor

No, env vars should always be uppercase.
I mean that you can inject secrets in yaml case-insensitively, so you can use from_secret: xyz or from_secret: XYZ

@GamePlayer-8
Copy link
Author

I'm using:

secrets:
 - xyz
 - XYZ

And only with the uppercase contains the actual secret.

@qwerty287
Copy link
Contributor

Hmm then this should be updated.

@anbraten
Copy link
Member

anbraten commented Sep 19, 2023

secrets are always converted to lowercase. Env vars which the secret is exposed as if using - secrets: [secret_name] are currently uppercase. I see the confusion. Actually full uppercase could be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants