Read-only clarification: omitted-field semantics for repository GitHub Actions permissions when Actions are disabled #204482
Replies: 6 comments
|
@findpainte-hub What the docs actually sayThe REST API endpoints for GitHub Actions permissions page defines the schema for
So to your questions directly:
Practical suggestionSince the omitted-field behavior isn't documented, the safe move — when you do authorize a change — is to always send all three fields explicitly on every For an authoritative answer to the undocumented parts specifically, GitHub Support(https://support.github.com/) or filing feedback via the "Ask a question" / "Make a suggestion" links at the bottom of that docs page are the two channels that reach the REST docs and Actions product teams respectively — this repo/community forum won't get you an official answer to the undocumented-behavior questions, only the documented ones. |
|
Based on the current GitHub REST API documentation, I don't think the behavior you're asking about is fully specified. For More importantly, for The safest conclusion from the published documentation is:
The documentation does confirm that the fields can be supplied together. For example, GitHub's own request example supplies: {
"enabled": true,
"allowed_actions": "selected",
"sha_pinning_required": true
}and the endpoint returns However, this still doesn't establish that explicitly sending previously observed values is a guaranteed way to restore an identical internal repository policy. The API exposes the supported policy state, but the documentation does not promise that a GET → modify → PUT cycle is lossless when the GET response omitted a field. Because of that, I would not recommend temporarily enabling Actions simply to discover the missing For your specific case, where the initial response is: {
"enabled": false,
"sha_pinning_required": false
}with no I would therefore ask GitHub staff to clarify whether the missing field is intentional API behavior when Actions are disabled and, specifically, whether omitted optional fields in the PUT request are preserved or otherwise modified. This is particularly worth clarifying because the documentation for API version |
|
@nirav-gajera and @meshal10613, thank you both for taking the time to provide such careful and safety-conscious analyses. Your replies confirm the central issue we needed to isolate: the public REST API contract does not define what an absent We will therefore keep the target repository unchanged and will not temporarily enable GitHub Actions merely to discover the missing value. Testing the behavior on an isolated temporary repository could provide useful empirical evidence about the current implementation, but it would not reveal the target repository’s latent baseline or provide a contractual guarantee that its original state could be restored exactly. Likewise, explicitly sending all three fields would only be safe if their initial values were already known or if a deliberate policy normalization had been separately reviewed and authorized. We will keep this discussion open while seeking clarification from GitHub Staff, the GitHub Actions product team, the REST API documentation team, or authoritative official documentation. If either of you encounters an official source defining:
we would be very grateful if you could share it here. Thank you again for helping us avoid an unsafe assumption. |
|
I think the important point here is not to infer behavior that the API documentation doesn't actually promise. If Because this is a private repository and the goal is to preserve its existing configuration exactly, I agree with the decision not to temporarily enable Actions just to find out what happens. Testing on another repository could tell you how the API currently behaves, but it wouldn't tell you what the original hidden state of this particular repository was. So I'd leave the repository untouched until GitHub clarifies the semantics. In this case, “we don't know” is a much safer answer than experimenting with a production repository and hoping the omitted fields are preserved. |
This comment was marked as low quality.
This comment was marked as low quality.
|
@Mothukuri-venu, thank you for this careful and safety-focused confirmation. Your distinction between observing current behavior on another repository and recovering the unknown latent baseline of this specific repository is particularly important. An empirical test could characterize current API behavior, but it could not prove that the target repository would be restored to its exact original state. We will therefore keep the repository unchanged and continue waiting for authoritative clarification from GitHub Staff, the GitHub Actions product team, the REST API documentation team, or official documentation. If you encounter an official source defining the omitted-field semantics or guaranteeing exact policy restoration, we would be grateful if you could share it here. Thank you again for helping us preserve a fail-closed approach. |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
💬 Feature/Topic Area
API
Body
Repository type: private repository owned by a personal GitHub Free account
REST API version:
2026-03-10No repository mutation has been performed. This question is intended to obtain authoritative documentation before any change is authorized.
The following read-only request:
GET /repos/{owner}/{repo}/actions/permissionsreturns HTTP 200 with the following observable state:
{ "enabled": false, "sha_pinning_required": false }The
allowed_actionsproperty is absent from the response.The REST documentation marks:
enabledas required for PUT;allowed_actionsas optional;sha_pinning_requiredas optional.However, the documentation does not appear to define the behavior of omitted optional fields.
Before authorizing any repository setting change, we need clarification on the following points:
When
enabled=false, is the GET response a complete and canonical representation of the repository Actions policy?Does an absent
allowed_actionsproperty mean:Is there a strictly read-only REST, GraphQL, or administrative surface that exposes the exact effective or stored value of
allowed_actionswhile Actions are disabled?For:
PUT /repos/{owner}/{repo}/actions/permissionswhat is the documented behavior when
allowed_actionsorsha_pinning_requiredis omitted?Does GitHub:
If all three fields—
enabled,allowed_actions, andsha_pinning_required—are supplied explicitly, can they be supplied both when enabling and when disabling Actions?If the three previously observed values are explicitly reapplied, does GitHub guarantee restoration of the same stored repository policy?
If a repository initially returns
enabled=falsewithallowed_actionsabsent, what documented request sequence can temporarily enable Actions and subsequently restore the repository to the same supported configuration?Is this behavior defined and stable for GitHub.com REST API version
2026-03-10?A response from GitHub staff, the GitHub Actions product team, the REST API documentation team, or a link to authoritative documentation would be particularly helpful.
No access to the private repository is requested. Please do not change any repository setting.
All reactions