I am trying to store SASToken as GitHub secret. When trying to update the secrets it is not getting updated, its always null. I'm following all steps to encrypt the value before updating in secrets, like mentioned in this link https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28. I'm using "Create or update an environment secret https://api.github.com/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/SECRET_NAME".Not sure what I am missing.
Used the steps in the link to create the environment secret https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28. But the value is not updating.
I posted an answer on another SO post but my guess is that you are using the public key for the repository, not the environment.
Try using the Get an Environment Public Key endpoint and saving your secret again. This appears to have worked for me, though I'm going to do more testing to double check.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With