mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
Make all secrets case insensitive by formatting them to uppercase (#470)
* Uppercase secrets, print error when secret with same name already exists * Test lower-to-upper case formatting for secrets
This commit is contained in:
parent
501e2e4d5f
commit
078494e07c
3 changed files with 15 additions and 0 deletions
|
@ -61,6 +61,9 @@ type expressionEvaluator struct {
|
|||
}
|
||||
|
||||
func (ee *expressionEvaluator) Evaluate(in string) (string, bool, error) {
|
||||
if strings.HasPrefix(in, `secrets.`){
|
||||
in = `secrets.`+strings.ToUpper(strings.SplitN(in, `.`, 2)[1])
|
||||
}
|
||||
re := ee.Rewrite(in)
|
||||
if re != in {
|
||||
log.Debugf("Evaluating '%s' instead of '%s'", re, in)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue