Skip to content

docs(cli): make mergify auth login the way to authenticate - #12687

Open
sileht wants to merge 1 commit into
mainfrom
devs/sileht/mrgfy-8704-docs-auth-login/make-mergify-auth-login-way-authenticate--ab17a200
Open

docs(cli): make mergify auth login the way to authenticate#12687
sileht wants to merge 1 commit into
mainfrom
devs/sileht/mrgfy-8704-docs-auth-login/make-mergify-auth-login-way-authenticate--ab17a200

Conversation

@sileht

@sileht sileht commented Sep 4, 2026

Copy link
Copy Markdown
Member

The CLI docs told everyone to hand it a GitHub token: GITHUB_TOKEN, or
whatever gh auth token returns. That credential is now the deprecated
path for the Mergify API, so every page that led with it was steering new
users onto it.

mergify auth login signs in through an OAuth 2.0 device grant and stores
a Mergify-issued user token in the OS credential store. Document it as the
way in, and mark GITHUB_TOKEN and the gh auth token fallback deprecated
where they back a Mergify API call.

Two things the rewrite is careful not to say. CI does not run an
interactive sign-in, so the application-key guidance stays exactly as it
was, and the ci commands still need a ci key that a user token will
not replace. And Stacks is a pure GitHub API client: it never calls
api.mergify.com, so a GitHub token is what it needs, mergify auth login
does nothing for it, and nothing about it is deprecated. Both pages that
cover Stacks now say so outright, since the old wording ("point
MERGIFY_TOKEN or GITHUB_TOKEN at a GitHub token") invited exactly the
mix-up the page below it warns about. Stacks still reads MERGIFY_TOKEN
first, and a dozen other pages tell readers to put an application key
there, so the setup page keeps that warning rather than dropping it with
the sentence that used to carry it.

cli/agents.mdx is in scope for the same reason as the other two: its
Authentication section opened by recommending a GitHub token, which after
this change would be the docs' loudest pointer at the deprecated path. So
is the /cli landing page, which sold the CLI on reusing your gh login.

api/usage.mdx loses half a sentence: a PAT is still a fine way to call the
API directly, but it is no longer a reason to reach for the CLI.

Details worth stating exactly, because each one was wrong in a first
draft and checked against the shipped engine and dashboard: the approval
page is a form you type the code into, not one that shows you a code, and
it asks for a token name; the 20-token ceiling is refused in the browser,
so a login that never completes is explained there and not in the
terminal; credentials are keyed by API URL, so an on-premise sign-in only
holds for commands that resolve the same URL; and mergify config validate needs no credential at all, since it fetches the public schema
and checks the file locally.

No changelog entry. Deprecation is not the announcement, removal will be.

Fixes MRGFY-8704

Copilot AI lite review requested due to automatic review settings September 4, 2026 15:27
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections September 4, 2026 15:27 Failure
@mergify

mergify Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 6 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 👀 Review Requirements 👀 reviews
🔴 🔎 Reviews 👀 reviews
🟢 🤖 Continuous Integration
🟢 Enforce conventional commit
🟢 📕 PR description
🟢 🚦 Auto-queue

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.
  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]
    • author = renovate[bot]
    • all of:
      • author = mergify-ci-bot
      • -head ~= ^docs-agent/

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

Show 4 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success = build
    • check-success = lint
    • check-success = test
    • any of:
      • check-success = test-broken-links
      • label = ignore-broken-links
    • any of:
      • check-success=Cloudflare Pages
      • -head-repo-full-name~=^Mergifyio/

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team September 4, 2026 15:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The updated /cli landing copy is slightly misleading about Stacks requiring a gh login rather than GitHub credentials more generally.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the Mergify CLI documentation to make mergify auth login (OAuth device flow + stored Mergify user token) the primary authentication path for Mergify API–backed commands, while explicitly clarifying that Stacks continues to require GitHub API credentials and is unaffected by the deprecation of GitHub-token auth to the Mergify API.

Changes:

  • Rewrites CLI authentication docs to document mergify auth login as the default, and marks GITHUB_TOKEN / gh auth token as deprecated fallbacks for Mergify API calls.
  • Clarifies Stacks authentication requirements and updates links/anchors to point to a dedicated “GitHub token for Stacks” section.
  • Removes the CLI as an example motivation for using a GitHub PAT directly against the Mergify API.
File summaries
File Description
src/pages/cli/index.astro Updates /cli landing copy to lead with mergify auth login and mention Stacks’ GitHub auth needs.
src/content/docs/stacks/team.mdx Updates onboarding step link to the new Stacks-specific GitHub token section.
src/content/docs/stacks/setup.mdx Rewrites Stacks GitHub auth guidance and adds a caution about MERGIFY_TOKEN precedence.
src/content/docs/cli/usage.mdx Major rewrite of authentication guidance; adds Mergify-vs-GitHub API split, device flow instructions, and token resolution order.
src/content/docs/cli/agents.mdx Updates agent/skills authentication guidance to prefer mergify auth login and clarify Stacks exceptions.
src/content/docs/api/usage.mdx Removes reference to the CLI as a reason to use a GitHub PAT for direct API calls.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/pages/cli/index.astro Outdated
The CLI docs told everyone to hand it a GitHub token: `GITHUB_TOKEN`, or
whatever `gh auth token` returns. That credential is now the deprecated
path for the Mergify API, so every page that led with it was steering new
users onto it.

`mergify auth login` signs in through an OAuth 2.0 device grant and stores
a Mergify-issued user token in the OS credential store. Document it as the
way in, and mark `GITHUB_TOKEN` and the `gh auth token` fallback deprecated
where they back a Mergify API call.

Two things the rewrite is careful not to say. CI does not run an
interactive sign-in, so the application-key guidance stays exactly as it
was, and the `ci` commands still need a `ci` key that a user token will
not replace. And Stacks is a pure GitHub API client: it never calls
api.mergify.com, so a GitHub token is what it needs, `mergify auth login`
does nothing for it, and nothing about it is deprecated. Both pages that
cover Stacks now say so outright, since the old wording ("point
MERGIFY_TOKEN or GITHUB_TOKEN at a GitHub token") invited exactly the
mix-up the page below it warns about. Stacks still reads MERGIFY_TOKEN
first, and a dozen other pages tell readers to put an application key
there, so the setup page keeps that warning rather than dropping it with
the sentence that used to carry it.

cli/agents.mdx is in scope for the same reason as the other two: its
Authentication section opened by recommending a GitHub token, which after
this change would be the docs' loudest pointer at the deprecated path. So
is the `/cli` landing page, which sold the CLI on reusing your `gh` login.

api/usage.mdx loses half a sentence: a PAT is still a fine way to call the
API directly, but it is no longer a reason to reach for the CLI.

Details worth stating exactly, because each one was wrong in a first
draft and checked against the shipped engine and dashboard: the approval
page is a form you type the code into, not one that shows you a code, and
it asks for a token name; the 20-token ceiling is refused in the browser,
so a login that never completes is explained there and not in the
terminal; credentials are keyed by API URL, so an on-premise sign-in only
holds for commands that resolve the same URL; and `mergify config
validate` needs no credential at all, since it fetches the public schema
and checks the file locally.

No changelog entry. Deprecation is not the announcement, removal will be.

Fixes MRGFY-8704

Change-Id: Iab17a20075d1e8a8905a1fc0b04bd3b578c001b0
@sileht
sileht force-pushed the devs/sileht/mrgfy-8704-docs-auth-login/make-mergify-auth-login-way-authenticate--ab17a200 branch from 84ce6ee to c33ad8c Compare September 4, 2026 15:35
@sileht

sileht commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial 84ce6ee 2026-09-04 15:35 UTC
2 content 84ce6ee → c33ad8c (raw) 2026-09-04 15:35 UTC

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections September 4, 2026 15:35 Failure
@sileht
sileht marked this pull request as ready for review September 4, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants