GitLab token rotation with Linear

Topics: GitLab, Linear

This procedure rotates a GitLab personal access token and reconnects the Linear integration, including updated webhooks.

Rotating a GitLab personal access token

When a GitLab personal access token (PAT) expires or needs rotation, use the glab CLI:

glab token rotate --user @me "TokenName" --duration 365d
  • --user @me targets your personal access tokens
  • --duration accepts days (365d), weeks (52w), or hours (8760h)
  • Maximum duration is 365 days
  • Alternative: --expires-at 2027-06-18 for an exact date

Updating the Linear integration

Linear doesn’t have a “update token” button. To use the new token:

  1. Go to Linear Settings > Features > Integrations > GitLab
  2. Click Disable
  3. Click Enable to re-launch the setup pop-up
  4. Enter the new token
  5. Click Connect

Important: Disabling and re-enabling generates a new webhook URL and secret. You must update webhook settings in all connected GitLab projects/groups:

  1. Go to GitLab Project/Group Settings > Webhooks
  2. Update the webhook URL and secret from Linear
  3. Verify triggers: Push events, Comments, Merge request events, Pipeline events