Skip to content

fix: use PAT instead of GITHUB_TOKEN for release tag workflow#484

Merged
eggshell merged 1 commit intomainfrom
cullen/release-with-pat
Mar 3, 2026
Merged

fix: use PAT instead of GITHUB_TOKEN for release tag workflow#484
eggshell merged 1 commit intomainfrom
cullen/release-with-pat

Conversation

@eggshell
Copy link
Contributor

@eggshell eggshell commented Mar 3, 2026

Pull Request Description

What and why?

The create_release_tag workflow uses the default GITHUB_TOKEN to push tags and create releases. GitHub Actions intentionally prevents events created by GITHUB_TOKEN from triggering other workflows, which means the pypi.yaml workflow (triggered on push: tags: v*.*.*) never fires after a tag is created.

This PR switches to a PAT (LIBRARY_RELEASE_PAT) for both the checkout token (used by git push) and the gh release create step, allowing downstream workflows to trigger.

How to test

  1. Add a LIBRARY_RELEASE_PAT repo secret with a PAT that has contents: write scope
  2. Run the "Create Release Tag" workflow
  3. Verify the PyPI publish workflow triggers on the new tag

What needs special review?

  • Ensure the LIBRARY_RELEASE_PAT secret is created in the repo before merging

Dependencies, breaking changes, and deployment notes

  • Requires a new repo secret: LIBRARY_RELEASE_PAT (PAT with contents: write permission)
  • No breaking changes

Release notes

Checklist

  • What and why
  • Screenshots or videos (Frontend)
  • How to test
  • What needs special review
  • Dependencies, breaking changes, and deployment notes
  • Labels applied
  • PR linked to Shortcut
  • Unit tests added (Backend)
  • Tested locally
  • Documentation updated (if required)
  • Environment variable additions/changes documented (if required)

Events created by the default GITHUB_TOKEN do not trigger downstream
workflows. This prevents the PyPI publish workflow from running when
a tag is pushed by the create_release_tag workflow. Switch to a PAT
(LIBRARY_RELEASE_PAT) for both the checkout token and gh release
create to allow the tag push event to trigger pypi.yaml.

Amp-Thread-ID: https://ampcode.com/threads/T-019cb4fe-12f8-7048-886a-f54feb449e88
Co-authored-by: Amp <amp@ampcode.com>
@eggshell eggshell added the chore Chore tasks that aren't bugs or new features label Mar 3, 2026
@eggshell eggshell requested review from cachafla and nibalizer March 3, 2026 18:41
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Pull requests must include at least one of the required labels: internal (no release notes required), highlight, enhancement, bug, deprecation, documentation. Except for internal, pull requests must also include a description in the release notes section.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

PR Summary

This pull request updates the release creation workflow to use the LIBRARY_RELEASE_PAT secret instead of the default GITHUB_TOKEN in two key areas:

  1. In the GitHub checkout action, a new parameter token is added with the value ${{ secrets.LIBRARY_RELEASE_PAT }}. This enables the checkout step to use the release-specific token for operations that might require elevated privileges or a different permission set.

  2. In the final step where the release tag is created, the environment variable GITHUB_TOKEN has been replaced with ${{ secrets.LIBRARY_RELEASE_PAT }}. This ensures that subsequent actions that depend on the token for creating releases and generating notes are authenticated with the correct token.

These changes are focused on enhancing the release process by switching to a different secret token, likely to allow improved control over token permissions or to address specific requirements of the release management process.

Test Suggestions

  • Validate that the workflow triggers correctly when a release is created and that it uses the LIBRARY_RELEASE_PAT for authentication.
  • Manually trigger the workflow in a test environment to confirm that releases are properly created and notes are generated without errors.
  • Check that the token substitution works as expected by inspecting logs or output variables, ensuring that the correct token is used at each step.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Pull requests must include at least one of the required labels: internal (no release notes required), highlight, enhancement, bug, deprecation, documentation. Except for internal, pull requests must also include a description in the release notes section.

@eggshell eggshell added the internal Not to be externalized in the release notes label Mar 3, 2026
@eggshell eggshell merged commit ef050c0 into main Mar 3, 2026
8 of 10 checks passed
@eggshell eggshell deleted the cullen/release-with-pat branch March 3, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Chore tasks that aren't bugs or new features internal Not to be externalized in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants