Skip to content

chore: replace $(azuresdk-github-pat) with $(GH_TOKEN) and add login-to-github step#26871

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/update-azure-sdk-pat-to-gh-token
Open

chore: replace $(azuresdk-github-pat) with $(GH_TOKEN) and add login-to-github step#26871
Copilot wants to merge 3 commits into
mainfrom
copilot/update-azure-sdk-pat-to-gh-token

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

Summary

Replaces all references to $(azuresdk-github-pat) in YAML pipeline files outside of eng/common with $(GH_TOKEN), and adds a login-to-github step before each usage to mint the token via the standard GitHub App login template.

Files changed

eng/pipelines/templates/jobs/archetype-go-release.yml

  • Added login-to-github.yml template step before the PowerShell@2 task in CheckReleaseJob that uses the GitHub token.
  • Replaced $(azuresdk-github-pat)$(GH_TOKEN) in the task's env section.

eng/pipelines/mgmt-auto-release.yml

  • Added login-to-github.yml template step before the ShellScript@2 task that passes the GitHub token as an argument.
  • Replaced $(azuresdk-github-pat)$(GH_TOKEN) in the script args.

Login template used

- template: /eng/common/pipelines/templates/steps/login-to-github.yml
  parameters:
    TokenOwners:
      - azure

This mints a short-lived GitHub App installation token and exports it as the GH_TOKEN pipeline variable, replacing the need for the static PAT $(azuresdk-github-pat).

Related files NOT changed (under eng/common, excluded per task scope)

  • eng/common/pipelines/templates/steps/git-push-changes.yml
  • eng/common/pipelines/templates/steps/create-pull-request.yml
  • eng/common/pipelines/templates/steps/verify-restapi-spec-location.yml
  • eng/common/pipelines/templates/steps/create-tags-and-git-release.yml

go - aztemplate - Successful run
go - mgmt auto release

…to-github step

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-go/sessions/0ec8d865-9919-40f2-80bd-4cb39f027670

Co-authored-by: chidozieononiwu <31145988+chidozieononiwu@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Azure DevOps pipeline YAMLs to stop using the static $(azuresdk-github-pat) and instead mint a short-lived GitHub App installation token via the standard login-to-github.yml step, consuming it through $(GH_TOKEN).

Changes:

  • Added /eng/common/pipelines/templates/steps/login-to-github.yml before GitHub token usage in relevant pipelines.
  • Replaced $(azuresdk-github-pat) references with $(GH_TOKEN) in the updated pipelines.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
eng/pipelines/templates/jobs/archetype-go-release.yml Adds login-to-github and switches the Verify step’s GitHub token env from the PAT to $(GH_TOKEN).
eng/pipelines/mgmt-auto-release.yml Adds login-to-github and switches the script argument from the PAT to $(GH_TOKEN).

Comment thread eng/pipelines/mgmt-auto-release.yml Outdated
@chidozieononiwu chidozieononiwu force-pushed the copilot/update-azure-sdk-pat-to-gh-token branch from ce9761b to af5b424 Compare May 23, 2026 03:00
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.

3 participants