I am trying to use gh api --method PUT orgs/<ORG>/actions/permissions/selected-actions
that accepts 3 fields: one of them patterns_allowed
. I have tried multiple ways to pass the data, but I always get
{
"message": "Invalid request.\n\nFor 'properties/patterns_allowed', \"...\" is not an array.",
"documentation_url": "https://docs.github.com/rest/reference/actions#set-allowed-actions-for-an-organization"
}
One of this attempts looks like this:
ALLOWED="foo,bar"
gh api --method PUT \
orgs/${{github.repository_owner}}/actions/permissions/selected-actions \
--field "github_owned_allowed=true" \
--field "verified_allowed=false" \
--field "patterns_allowed=[$ALLOWED]"
What is the proper way to pass array type field?