Description
Powershell Code Which converted from Postman:
`$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "Basic ")
$headers.Add("Content-Type", "application/json")
$body = "{
n
"encrypted_value":
"c2VjcmV50",
n "key_id
": "
"
`n}"
$response = Invoke-RestMethod 'https://api.github.com/repos/owner/repo/actions/secrets/yfsf' -Method 'PUT' -Headers $headers -Body $body
$response | ConvertTo-Json`
Issue:
encrypted_value is allowing specific types of values : c2VjcmV0 , If I need to add value ( "encrypted_value": "ainsdr-34234vsdf-dfdf") which is getting error message for regex error { "message": "Invalid request.\n\nainsdr-34234vsdf-dfdf does not match /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$/.", "documentation_url": "https://docs.github.com/rest/reference/actions#create-or-update-a-repository-secret" }
instead of store my value.
Expectation :
encrypted_value should be allow any value, This is should be dynamic. I can add any value inside the block of encrypted_value .Also I can provide any value from UI which will be accepted but in rest API it's gives regex error. Please fix the issue.
Github Documents Link
https://docs.github.com/en/rest/actions/secrets#create-or-update-a-repository-secret