/github:provision-deploy-identity [owner/repo] [environment...]from github
Sets up and audits the identity a GitHub Actions deploy job signs in to Azure and Entra with, both halves: the repo's deployment environments and the federated credential that trusts one. Reads the repo's visibility, each environment's reviewers, deployment-branch policy and variables, the workflows that name one and the OIDC subject form, and flags an environment any branch can deploy from, one a workflow would create unprotected, and one identity shared by a protected and an open environment. Splits the work by the tenant's authorizationPolicy and the user's roles: the GitHub steps by gh api as the repo's owner or admin, a user-assigned managed identity where the user holds Contributor, an app registration where the policy or a role allows, else portal steps for an Entra admin with the exact subject. Writes environments, branch policies and the ID variables only on a yes, each environment before the credential that trusts it. Assigning the identity's Azure role on its target is out of scope.
Ships in github. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A deploy job signs in by OIDC: GitHub mints a token whose subject names the job's environment, and a federated credential on an Entra identity trusts that subject. Each half has its own admin, the repo's and the tenant's, and this skill sets up both in the order that keeps the gate shut. The environment is the whole gate, and by default it is none:
repo:<owner>/<repo>:environment:<name> whatever branch it ran from
(docs.github.com actions/reference/security/oidc, read 2026-11-17).deployment_branch_policy is null "to allow all branches
to deploy" (rest/deployments/environments, read 2026-11-17), and
one a workflow creates "will not have any protection rules"
(manage-environments, below).actions/how-tos/deploy/configure-and-manage-deployments/manage-environments,
read 2026-11-17).workflow_dispatch runs it against any
branch by API or CLI, as that branch's last commit holds it
(actions/reference/workflows-and-actions/events-that-trigger-workflows,
read 2026-11-17).So an environment exists, with a branch policy, before any credential trusts its subject.
Past references/github-half.md and
references/naming.md, docs.github.com by its
search,
curl -s 'https://docs.github.com/api/search/v1?query=<q>&language=en&client_name=x'
(no client_name: 400), then a hit's body,
curl -s 'https://docs.github.com/api/article/body?pathname=<hit url>';
then Learn, by microsoft-learn-mcp's search and fetch. A live page
that contradicts a line here wins: say so, act on the page, and route
the fix by capture-learning, bar a dated measured line that names the
page it overrules and the call that measured it, which a page changed
since its date sends back to re-measure. An observed claim is cited or
marked pending a doc check, and stands, marked observed, only where no
page covers it.
The arguments are the repo, owner/name, defaulting to the clone's
origin, and the environments to set up, such as production. An
organization's or tenant's names go into no file in any repo but its
own: the report and the admin's steps stay in the conversation.
gh can act as an account other than the one meant, and a 404 or
Could not resolve to a Repository from the wrong one looks exactly
like a missing repo. Name the account this session's gh acts as:
git config user.name # the account a per-identity gh wrapper picks here
gh api user -q .login
Configuring an environment takes the repo's owner, or admin on an
organization's repo (manage-environments, read 2026-11-17); its
variables take collaborator access (rest/actions/variables, read
2026-11-17). Every
gh call below runs as the login printed here. Leave gh auth refresh and gh auth switch to the user.
For the Entra half, check the tenant before any az call:
az account show --query '{tenant: tenantId, subscription: id, user: user.name}'
Read only, by the commands in references/github-half.md § Reads: the repo's visibility and the account's admin flag, each environment's protection rules and branch policy, its branch patterns, the environment and repo variables, the OIDC subject form, and the workflows that name an environment, with their triggers.
A private repo's plan decides what a gate can hold: on Free there are no environments, and on Pro or Team no required reviewers, so the branch policy is the only gate (its § "What the plan allows"). The plan is the owner's: ask where the repo is private and the reads cannot settle it.
Report each finding in § Findings with its why and fix: an environment any branch can deploy from, one a workflow names that does not exist, a credential trusting a deleted environment, one identity across a protected and an open environment, reviewers the plan does not allow, and a credential in the other subject form.
Where an identity already exists, read its credentials too, so the
shared-identity finding can be judged (Learn,
workload-identity-federation-create-trust and its user-assigned
managed identity page, read 2026-11-17):
az ad app federated-credential list --id <app-id>
az identity federated-credential list --identity-name <identity> --resource-group <rg>
Who can make each piece decides who does each step. Read the tenant's policy:
az rest --method GET --url https://graph.microsoft.com/v1.0/policies/authorizationPolicy --query defaultUserRolePermissions.allowedToCreateApps
Its least privilege is Policy.Read.All
(Learn, graph/api/authorizationpolicy-get, read 2026-11-17); a 403
there is a question for the admin, not a no. allowedToCreateApps is
the admin center's Users can register applications
(graph/api/resources/defaultuserrolepermissions, read 2026-11-17).
| Step | Who can |
|---|---|
| Environments, branch policies, reviewers | the repo's owner, or an organization repo's admin |
| Environment variables | a collaborator |
| A user-assigned managed identity and its federated credential | Contributor or Owner, on the identity's resource group |
| An app registration | anyone, while allowedToCreateApps is true; else Application Developer, Application Administrator, Cloud Application Administrator, Global Administrator or Hybrid Identity Administrator |
| An app's federated credential | the app's owner, or Application, Cloud Application, Global or Hybrid Identity Administrator |
From Learn, read 2026-11-17: workload-identity-federation-create-trust-user-assigned-managed-identity
("your account needs the Contributor or Owner role assignment"; none on
a system-assigned identity), cli/azure/azure-cli-sp-tutorial-1 (the
five roles), entra/identity/role-based-access-control/permissions-reference
(only Application Developer is added as the owner of what it creates)
and workload-identity-federation-create-trust (the app's owner or
four roles).
The policy governs app registrations alone: a user with
allowedToCreateApps false who holds Contributor on a resource group
can still make a user-assigned managed identity and its credential,
where the target accepts a managed identity. Which identity a target
accepts, and the role it then needs, is the access skill's, where it
is installed; the user says which directory roles they hold,
active or eligible.
Put the whole plan to the user by one AskUserQuestion, a table per
environment:
main by default, matched against
GITHUB_REF, where * does not match /.prevent_self_review only with a second reviewer.id-<repo>-deploy-<env>, an app
registration app-<repo>-deploy-<env>, its federated credential
github-<repo>-<env>, production written prod. The tenant's
own pattern wins where its existing identities show one, which the
plan says; an existing identity keeps its name, and a name another
object holds is never proposed.repo:<owner>/<repo>:environment:production or the immutable
repo:<owner>@<owner-id>/<repo>@<repo-id>:environment:production.AZURE_CLIENT_ID, AZURE_TENANT_ID and
AZURE_SUBSCRIPTION_ID on the environment, or secrets on the user's
word (§ Writes, 3, says what each
shows).On the yes, in § Writes' order:
the environment with custom_branch_policies, then each pattern, each
read back by step 2's reads before the next. This comes before any
credential: until the environment holds its patterns, a credential
trusting its name trusts every branch. The variables wait for the
identity's client ID, after step 6.
The administrator bypass, where the plan allows turning it off, is the environment's Settings page: no REST field for it is documented.
Where the user can make it, the commands are Learn's
(workload-identity-federation-create-trust and its user-assigned
managed identity page, read 2026-11-17); the issuer and audience are
fixed, and the subject is step 4's, exactly:
az identity federated-credential create --name <credential> --identity-name <identity> --resource-group <rg> --issuer 'https://token.actions.githubusercontent.com' --subject '<subject>' --audiences 'api://AzureADTokenExchange'
az identity show --name <identity> --resource-group <rg> --query clientId --output tsv
For an app registration, az ad app federated-credential create --id <app-id> --parameters credential.json, the file holding name,
issuer, subject and audiences, written with Write. A wrong
subject saves without error and fails only at the first sign-in:
access's federated credential item has that and its other traps,
propagation and the 20-per-identity cap among them; where it is not
linked, Learn's workload-identity-federation-considerations.
Where an admin must make it, write the steps for the user to send, in the conversation and in no file:
https://token.actions.githubusercontent.com, subject <subject>
spelled out, audience api://AzureADTokenExchange. Or the
GitHub actions deploying Azure resources scenario, entity type
Environment, then check that the subject field it fills reads
<subject> exactly: Learn's portal steps never print the subject
the scenario builds, so whether it writes the immutable form is
unverified (Learn, workload-identity-federation-create-trust,
read 2026-11-17).Then write step 5's variables, read back.
The job names the environment, asks for the token and passes the IDs
(Azure/login README on master, read 2026-11-17):
jobs:
deploy:
environment: production
permissions:
id-token: write
contents: read
steps:
- uses: azure/login@<full commit SHA> # pin as coding-ci-workflows.md says
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
The first run's log names the subject GitHub presented, under
Federated token details as subject claim, and a mismatch fails
AADSTS700213: No matching federated identity record found for presented assertion subject '<subject>', case-sensitively;
AADSTS7002138 is the same subject differing only in case (Azure/login
README; Learn, entra/identity-platform/reference-breaking-changes,
read 2026-11-17). Compare that subject with the credential's, character
for character, before changing either.
Read a job's log before its run completes by the jobs endpoint, as
a what-if job's before approving the next at an environment gate:
gh api --allow-escape-sequences repos/<owner>/<repo>/actions/jobs/<id>/logs.
Without the flag gh prints nothing and exits 1, naming the flag only
on stderr (observed 2026-11-20, gh 2.104.0).
Each finding with its why and fix; each write as its read-back shows
it; the split, who did or does each Entra step; the admin's steps where
they went out; and what the identity still needs, its role, for
access or the product's skill.
access's, a Fabric workspace role or tenant setting the product's
skill.What SKILL.md sets; muted values are Claude Code's defaults
Use when wiring a GitHub Actions workflow to Azure or Entra by OIDC (azure/login, a federated credential, no secret), creating or protecting a deployment environment, adding required reviewers or a deployment-branch policy, setting AZURE_CLIENT_ID and AZURE_TENANT_ID for a deploy job, preparing steps for an Entra admin when users cannot register apps, or asking why any branch or a workflow_dispatch run can deploy to production. Not for the role itself (access) or a Fabric workspace role.
inheritxhighnpx claudepluginhub wardawgmalvicious/claude-plugins --plugin github4 skills in this plugin
/audit-repoAudits a GitHub repo against a personal or org policy, with a read-only script: its merge methods, branch auto-delete, secret scanning, Actions token and pins, deploy keys, rulesets and bypasses, required checks no job reports, CODEOWNERS and release-tag ruleset, its About panel (description, homepage, topics), social preview card and community profile (README, licence, CONTRIBUTING, code of conduct, PR template). Reports each finding's reason and fix. Then, one yes at a time, proposes About text as a diff, renders three card candidates, snapshots settings with its repo-settings.ps1, and adds the scaffolds a repo lacks: a handoff queue with lint hook and inbox, a pre-commit baseline (gitleaks, identity-guard) and CI workflow, an instruction file, a licence, CONTRIBUTING, a conduct code, a PR template. On a new repo that is its setup; on an old one, its gaps. Changes nothing without the user's yes. For a leak already pushed, or to put back settings after a recreate, use recreate-repo; to merge, land-branch./provision-boardSets up a GitHub Projects board for a repo's handoff queue, under a user or an organization, by copying a template project, which keeps views, fields and configured workflows, bar auto-add; with no template it builds the board from nothing. Its bundled provision-board.sh links the repo, sets the description and readme, makes the Status options (Open, Deferred, In flight, Done) through updateProjectV2Field with each kept option's id, the Priority and Reopen-when fields, the needs:* labels and any view of its views.json the board lacks, then reads each workflow's enabled flag against the contract. Optionally files the queue's briefs as issues on the board, after a denylist check that prints counts only, resumable, reading back each card's Status. Ends by naming what only GitHub's UI does: auto-add, and on a built board the standard workflows. Takes the owner and repo as arguments, names the acting gh account first, and runs nothing without the user's yes. The contract lives in its references/.Other plugins' skills for the same job