Skip to content

Revert "semantic release can't push to master" - #2364

Merged
MichaelMraka merged 1 commit into
RedHatInsights:masterfrom
MichaelMraka:pr1
Oct 15, 2026
Merged

MichaelMraka merged 1 commit into
RedHatInsights:masterfrom
MichaelMraka:pr1

Conversation

@MichaelMraka

@MichaelMraka MichaelMraka commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

This reverts commit 3e112b0.

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Restore the previous semantic-release workflow for direct version commits and tagging on master.

Bug Fixes:

  • Restore direct semantic-release commits and pushes to master, including version tags, instead of creating and auto-merging release pull requests.

Enhancements:

  • Remove semantic-release job concurrency controls and expanded GitHub token permissions introduced by the reverted workflow changes.

CI:

  • Revert the semantic-release workflow to its previous direct version update and tagging behavior.

@MichaelMraka
MichaelMraka requested a review from a team as a code owner October 15, 2026 12:32
@sourcery-ai

sourcery-ai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Reverts the branch-and-automated-PR release flow, returning semantic releases to direct commits and tag pushes on master with reduced workflow configuration.

File-Level Changes

Change Details Files
Restore direct version commits and tag pushes to the master workflow.
  • Remove concurrency serialization and elevated GitHub App permissions.
  • Restore version calculation, OpenAPI/VERSION updates, commit, and direct push flow.
  • Create and push the release tag after pushing the version commit.
  • Use the version as the automatic-update commit message and retain the duplicate-commit guard.
.github/workflows/semantic-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

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/semantic-release.yml" line_range="23-24" />
<code_context>
       with:
         client-id: ${{ secrets.SEMANTIC_RELEASE_APP_ID }}
         private-key: ${{ secrets.SEMANTIC_RELEASE_PK }}
-        permission-contents: write
-        permission-pull-requests: write
     - uses: actions/checkout@v7
       with:
</code_context>
<issue_to_address>
**Release token has excess permissions**

When the GitHub App installation has permissions beyond those required by this workflow, the token action issues a token with all installation permissions, and checkout persists it for Git operations. A compromised workflow step can use those unrelated permissions.

Explicitly limit the token to the contents and pull-request permissions this workflow requires.
</issue_to_address>

### Comment 2
<location path=".github/workflows/semantic-release.yml" line_range="45" />
<code_context>
+        sed -i 's|\("version": "\)[^"]*\("\)$|'"\1$VERSION_NEXT\2|;" $DOC_FILE
+        echo $VERSION_NEXT >VERSION
+        git commit -am "${VERSION_NEXT}"
+        git push
+        git tag "${VERSION_NEXT}" -m "${VERSION_NEXT}"
+        git push origin "${VERSION_NEXT}"
</code_context>
<issue_to_address>
**Release commits are rejected**

When master rules require pull requests or prevent the app from bypassing them, `git push` updates `master` directly, so branch protection rejects the version commit and the workflow stops before creating the tag or completing the release.

Restore a PR-based release path or configure the app to push directly under the branch rules.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 2 findings to address first, and the workflow now pushes version commits and tags directly to master, so a bad version can remain in repository history or trigger downstream release automation even after the workflow is reverted. Removing the token’s explicit permission limits also changes the authority available to the release job; reverting does not undo commits or tags already pushed.

Blocking findings: .github/workflows/semantic-release.yml:24, .github/workflows/semantic-release.yml:45


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines -23 to -24
permission-contents: write
permission-pull-requests: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Release token has excess permissions

When the GitHub App installation has permissions beyond those required by this workflow, the token action issues a token with all installation permissions, and checkout persists it for Git operations. A compromised workflow step can use those unrelated permissions.

Explicitly limit the token to the contents and pull-request permissions this workflow requires.

Prompt for AI agents
In `.github/workflows/semantic-release.yml` at lines 23-24:

**Release token has excess permissions**

When the GitHub App installation has permissions beyond those required by this workflow, the token action issues a token with all installation permissions, and checkout persists it for Git operations. A compromised workflow step can use those unrelated permissions.

Explicitly limit the token to the contents and pull-request permissions this workflow requires.

sed -i 's|\("version": "\)[^"]*\("\)$|'"\1$VERSION_NEXT\2|;" $DOC_FILE
echo $VERSION_NEXT >VERSION
git commit -am "${VERSION_NEXT}"
git push

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High · Release commits are rejected

When master rules require pull requests or prevent the app from bypassing them, git push updates master directly, so branch protection rejects the version commit and the workflow stops before creating the tag or completing the release.

Restore a PR-based release path or configure the app to push directly under the branch rules.

Prompt for AI agents
In `.github/workflows/semantic-release.yml` at line 45:

**Release commits are rejected**

When master rules require pull requests or prevent the app from bypassing them, `git push` updates `master` directly, so branch protection rejects the version commit and the workflow stops before creating the tag or completing the release.

Restore a PR-based release path or configure the app to push directly under the branch rules.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.89%. Comparing base (d875fde) to head (1892f84).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2364      +/-   ##
==========================================
- Coverage   58.95%   58.89%   -0.07%     
==========================================
  Files         151      151              
  Lines        9690     9706      +16     
==========================================
+ Hits         5713     5716       +3     
- Misses       3375     3386      +11     
- Partials      602      604       +2     
Flag Coverage Δ
unittests 58.89% <ø> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MichaelMraka
MichaelMraka merged commit dd7bf84 into RedHatInsights:master Oct 15, 2026
7 of 8 checks passed
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.

3 participants