ci: use github app token to push (should work with protected branch)#2254
Merged
jdobes merged 1 commit intoRedHatInsights:masterfrom Mar 13, 2026
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the semantic-release GitHub Actions workflow to use a GitHub App token for authenticated operations (compatible with protected branches) and reorders steps to generate the token before checkout and build cancellation. Sequence diagram for updated semantic release workflow token usagesequenceDiagram
participant GH as GitHub_Actions_Runner
participant WF as semantic_release_workflow
participant AT as create_github_app_token_action
participant APP as GitHub_App_for_semantic_release
participant CL as workflow_run_cleanup_action
participant CO as checkout_action
participant SR as semantic_release_step
participant API as GitHub_API_protected_branch
GH->>WF: Trigger workflow on push
WF->>AT: Run create_github_app_token_action with app_id and private_key
AT->>APP: Authenticate as GitHub App
APP->>API: Request installation access token
API-->>APP: Return installation access token
APP-->>AT: Provide GitHub_App_token
AT-->>WF: Output token as step_output
WF->>CL: Run workflow_run_cleanup_action with GITHUB_TOKEN
CL->>API: Cancel previous workflow_runs
WF->>CO: Run checkout_action with persist_credentials false
CO->>API: Fetch repository_code
API-->>CO: Return repository_code
WF->>SR: Run semantic_release_step with GH_TOKEN from app_token_output
SR->>API: Perform versioning and push to protected_branch using app_token
API-->>SR: Accept authenticated_operations on protected_branch
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
SC Environment Impact AssessmentOverall Impact: ⚪ NONE No SC Environment-specific impacts detected in this PR. What was checkedThis PR was automatically scanned for:
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider pinning
rokroskar/workflow-run-cleanup-actionto a specific tag or commit SHA instead of@masterto reduce supply-chain risk in the workflow. - Since you are already touching this workflow, it may be a good moment to upgrade
actions/checkout@v2andactions/setup-python@v2to their latest stable major versions to benefit from security and performance improvements.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider pinning `rokroskar/workflow-run-cleanup-action` to a specific tag or commit SHA instead of `@master` to reduce supply-chain risk in the workflow.
- Since you are already touching this workflow, it may be a good moment to upgrade `actions/checkout@v2` and `actions/setup-python@v2` to their latest stable major versions to benefit from security and performance improvements.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
2d62bd3 to
ee94963
Compare
MichaelMraka
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist
Summary by Sourcery
Update the semantic-release GitHub workflow to use a GitHub App token for releases and support pushing to protected branches.
CI: