feat: support use_immutable_subject and sub_claim_prefix on repository OIDC subject claim template - #3582
Conversation
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
…y OIDC subject claim template Wires the use_immutable_subject and sub_claim_prefix fields (already present on go-github v89's OIDCSubjectClaimCustomTemplate struct) through the github_actions_repository_oidc_subject_claim_customization_template resource, allowing existing repositories to opt into GitHub's immutable OIDC subject claim format on a per-repository basis without an org-wide change. Closes integrations#3548
7878e57 to
08da046
Compare
|
Not a maintainer, just helping with review triage, so this is a comment rather than a review. Building on what @RulerOf found above: I checked the write side too, and Same derived value before and after, exactly as in @RulerOf's examples. That has two consequences for this PR specifically. The attribute is Separately, The field is dropped. This matters because opting back out does work at the API level: on the same throwaway repo I set it to There's an existing idiom for this in the repo: I haven't run the acceptance tests. |


Summary
Wires
use_immutable_subjectandsub_claim_prefix— already present on go-github v89'sOIDCSubjectClaimCustomTemplatestruct — through togithub_actions_repository_oidc_subject_claim_customization_template.This lets a repository created before GitHub's July 15, 2026 immutable-subject-claims rollout opt in individually via Terraform, instead of requiring an org-wide toggle or an out-of-band REST call that Terraform can't track.
Changes
use_immutable_subject(bool, optional, computed) andsub_claim_prefix(string, optional, computed) added to the resource schemaCreateOrUpdateandRead, following the existingGetOk+new(...)pattern already used elsewhere in this resource (include_claim_keys) and in sibling resources (e.g.resource_github_enterprise_actions_workflow_permissions.go)docs/resources/...mdand its.tmplsource) and the example underexamples/resources/...updated to cover both new argumentsScoped to the repository-level resource only, matching the issue — the organization-level resource and this resource's
Deletebehavior are unchanged.Closes #3548
Test plan
TestAccGithubActionsRepositoryOIDCSubjectClaimCustomizationTemplate), since these require a live GitHub token this environment doesn't haveuse_default/include_claim_keysandcan_approve_pull_request_reviewspatterns for consistency