Skip to content

ci: use GitHub App identity instead of PAT for Agents-M365Copilot#1442

Merged
gavinbarron merged 2 commits into
mainfrom
gavinbarron/agents-m365copilot-app-identity
Jun 25, 2026
Merged

ci: use GitHub App identity instead of PAT for Agents-M365Copilot#1442
gavinbarron merged 2 commits into
mainfrom
gavinbarron/agents-m365copilot-app-identity

Conversation

@gavinbarron

@gavinbarron gavinbarron commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

Pivots the Agents-M365Copilot generation flow off the PAT-backed microsoftkiota GitHub service connection and onto the existing microsoft-graph-devx-bot GitHub App identity. PR creation already used the App, so this completes PAT elimination for Agents-M365Copilot checkout/push/PR.

Because microsoft/Agents-M365Copilot is a public repo, the checkout is done anonymously (no credential) and the App token is used only for the push.

Changes

  • scripts/set-app-token-push-url.ps1 (new): generates a GitHub App installation token (reusing Generate-Github-Token.ps1), masks it, and sets only the origin push URL to use it. Fetch stays anonymous.
  • language-generation-kiota.yml: added opt-in useGitHubAppAuth param (default false). When true → anonymous clone replaces the resource checkout; AKV secrets + push-URL step run before the push; existing git-push-files.ps1 / create-pull-request.ps1 unchanged. When false → microsoftgraph SDK repos behave exactly as before.
  • generation-pipeline.yml: removed the Agents-M365Copilot repo resource (the microsoftkiota endpoint) and its SDL-exclude entry; set useGitHubAppAuth: true on all 6 Agents jobs (csharp/python/typescript × v1/beta).

Validation

  • No microsoftkiota references remain; new script parses clean; no dangling checkout references; SDK-repo path untouched (param defaults false).

Note

  • The microsoft-graph-devx-bot App must have contents:write on microsoft/Agents-M365Copilot (PR creation already proves install + PR perms).

Automated change authored with GitHub Copilot CLI.

Microsoft Reviewers: Open in CodeFlow

Pivots the Agents-M365Copilot generation flow off the PAT-backed
`microsoftkiota` service connection and onto the existing
`microsoft-graph-devx-bot` GitHub App identity.

- Add opt-in `useGitHubAppAuth` param to language-generation-kiota.yml.
  When true, the public repo is cloned anonymously and the push remote is
  switched to a GitHub App installation token before pushing. SDK repos
  (param defaults false) are unaffected.
- Add scripts/set-app-token-push-url.ps1 to set the origin push URL to the
  App token without logging it (fetch stays anonymous).
- Remove the Agents-M365Copilot repo resource (microsoftkiota endpoint) and
  its SDL-exclude entry; set useGitHubAppAuth: true on the 6 Agents jobs.

PR creation already used the GitHub App, so this completes PAT elimination
for Agents-M365Copilot checkout/push/PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gavinbarron gavinbarron requested a review from a team as a code owner June 25, 2026 18:35
@ramsessanchez

Copy link
Copy Markdown
Contributor

any specific reason why were keeping PAT based auth as an option?

@gavinbarron

Copy link
Copy Markdown
Member Author

We are not

Comment thread .azure-pipelines/generation-templates/language-generation-kiota.yml Outdated
Comment thread .azure-pipelines/generation-templates/language-generation-kiota.yml Outdated
Comment thread .azure-pipelines/generation-templates/language-generation-kiota.yml Outdated
Co-authored-by: Gavin Barron <gavin.barron@gmail.com>
@gavinbarron gavinbarron merged commit cd15ac2 into main Jun 25, 2026
5 checks passed
@gavinbarron gavinbarron deleted the gavinbarron/agents-m365copilot-app-identity branch June 25, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants