Can't add negative value into orgsecret

drone orgsecret add yunfan telegram_chat_id -3999

or

drone orgsecret add --organization yunfan --name telegram_chat_id --data -3999

error message:
flag provided but not defined: -3999

you need to quote your value, otherwise it is interpreted as a flag.

drone orgsecret add yunfan telegram_chat_id ‘-3999’

or

drone orgsecret add yunfan ‘telegram_chat_id’ ‘-3999’

or

drone orgsecret add ‘yunfan’ ‘telegram_chat_id’ ‘-3999’

still, Incorrect Usage: flag provided but not defined: -3999 :joy::joy::joy:

Is there something wrong?

I can also reproduce. Unfortunately flag parsing is handled by an external library called urfave/cli so there is nothing we can really do to address this in Drone itself. There is an existing issue for this problem with a proposed workaround. See https://github.com/urfave/cli/issues/645

Another workaround is to load your secret from file:

$ echo -n ${SECRET} > secret.txt
$ drone orgsecret add yunfan telegram_chat_id @secret.txt
2 Likes