Skip to content

ci: use GitHub App token for release bump PR#438

Merged
ruromero merged 1 commit intoguacsec:mainfrom
ruromero:fix/release-pr-ci-trigger
Apr 27, 2026
Merged

ci: use GitHub App token for release bump PR#438
ruromero merged 1 commit intoguacsec:mainfrom
ruromero:fix/release-pr-ci-trigger

Conversation

@ruromero
Copy link
Copy Markdown
Collaborator

@ruromero ruromero commented Apr 23, 2026

Summary

  • Post-release version bump PRs created by github-actions[bot] using GITHUB_TOKEN don't trigger CI checks (GitHub's anti-recursion protection)
  • Use actions/create-github-app-token@v2 with the installed GitHub App (CI_APP_ID / CI_APP_PRIVATE_KEY secrets) to generate a token
  • Pass this token to peter-evans/create-pull-request@v8 so the resulting PR triggers the "Build and test Java 21" workflow

Test plan

  • Trigger a release via workflow_dispatch and verify the bump PR triggers the Build check
  • Verify the PR is created by the GitHub App identity, not github-actions[bot]

🤖 Generated with Claude Code

Summary by Sourcery

CI:

  • Add a workflow step to generate a GitHub App token from CI_APP_ID and CI_APP_PRIVATE_KEY secrets and use it for the release bump pull request.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Configures the release workflow to generate a GitHub App-based token and use it for the post-release bump pull request so that CI is triggered on the created PR.

Sequence diagram for release bump PR using GitHub App token

sequenceDiagram
    actor Developer
    participant ReleaseWorkflow as Release_workflow_release_yml
    participant GitHubApp as CI_GitHub_App
    participant GitHubAPI as GitHub_API
    participant BumpPR as Bump_Version_PR
    participant BuildWorkflow as Build_and_test_Java_21_workflow

    Developer->>ReleaseWorkflow: Trigger workflow_dispatch release
    ReleaseWorkflow->>ReleaseWorkflow: Run Maven release steps

    ReleaseWorkflow->>GitHubAPI: Request GitHub App token
    GitHubAPI-->>ReleaseWorkflow: Return installation access token

    ReleaseWorkflow->>GitHubApp: Use token with create_pull_request action
    GitHubApp->>GitHubAPI: Create bump version PR
    GitHubAPI-->>BumpPR: Open PR authored by GitHub App identity

    GitHubAPI->>BuildWorkflow: Trigger Build and test Java 21 on PR events
    BuildWorkflow-->>GitHubAPI: Report CI status on bump PR
Loading

File-Level Changes

Change Details Files
Generate a GitHub App installation token in the release workflow and use it for the version bump pull request.
  • Add a step that uses actions/create-github-app-token@v2 with CI_APP_ID and CI_APP_PRIVATE_KEY secrets to create a GitHub App token
  • Assign the app-token step an id so its outputs can be referenced later in the job
  • Pass the generated token output into peter-evans/create-pull-request@v8 via the token input so the bump PR is authored by the GitHub App and triggers CI
.github/workflows/release.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider adding a conditional or fallback path for forks or environments where CI_APP_ID / CI_APP_PRIVATE_KEY are not configured so the release workflow fails more gracefully instead of at the token-generation step.
  • Double-check that the GitHub App used here has the minimum required repo and workflow permissions for peter-evans/create-pull-request to operate, and document or enforce those permissions to avoid future permission-related failures.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a conditional or fallback path for forks or environments where `CI_APP_ID` / `CI_APP_PRIVATE_KEY` are not configured so the release workflow fails more gracefully instead of at the token-generation step.
- Double-check that the GitHub App used here has the minimum required repo and workflow permissions for `peter-evans/create-pull-request` to operate, and document or enforce those permissions to avoid future permission-related failures.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ruromero ruromero enabled auto-merge (squash) April 24, 2026 15:14
The post-release version bump PR created by github-actions[bot] using
GITHUB_TOKEN does not trigger CI checks (GitHub's anti-recursion rule).
Use a GitHub App token instead so the PR triggers the Build workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ruromero ruromero force-pushed the fix/release-pr-ci-trigger branch from 9ccd9e3 to ee0f9dc Compare April 27, 2026 13:49
@ruromero ruromero merged commit e049d46 into guacsec:main Apr 27, 2026
45 checks passed
@ruromero ruromero deleted the fix/release-pr-ci-trigger branch April 27, 2026 13:52
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