Skip to content

Conversation

jmgate
Copy link
Collaborator

@jmgate jmgate commented Jun 9, 2025

Type: Task

Description

This PR adds commit and tag signing to changes made by python-semantic-release in CI.

Motivation

Signing releases means we have a better security posture.

Implementation Details

  • Generate a SSH key pair locally.
  • Add the public key as a deploy key to your repository with write access.
  • Store both the public and private keys as environment secrets for the release environment.
  • Make the workflow changes shown in the diff such that python-semantic-release can use the keys for signing.

Summary by Sourcery

Configure the GitHub Actions release workflow to sign commits and tags using SSH keys

CI:

  • Add committer name and email inputs to python-semantic-release
  • Pass SSH private and public signing keys from repository secrets to the release job

Copy link

sourcery-ai bot commented Jun 9, 2025

Reviewer's Guide

CI workflow enhanced to produce GPG-signed release commits and tags by configuring python-semantic-release with SSH keys and committer metadata; an SSH key pair is generated, deploy key added to the repo, and both keys stored as environment secrets.

Sequence Diagram: Signed Release Commit and Tag Generation

sequenceDiagram
    participant Workflow as GitHub Actions Workflow
    participant PSR as python-semantic-release action
    participant Git

    Workflow->>PSR: Run with inputs (committer_email, committer_name, ssh_private_signing_key, ssh_public_signing_key)
    PSR->>Git: Configure committer details (name, email)
    PSR->>Git: Configure SSH key for signing (using private_key)
    Note over PSR,Git: python-semantic-release proceeds with release process
    PSR->>Git: Create release commit(s)
    PSR->>Git: Sign release commit(s)
    PSR->>Git: Create release tag(s)
    PSR->>Git: Sign release tag(s)
    PSR->>Git: Push signed commit(s) and tag(s) to remote repository
Loading

File-Level Changes

Change Details Files
Configure python-semantic-release for commit and tag signing
  • Add git_committer_email input
  • Add git_committer_name input
  • Include ssh_private_signing_key input
  • Include ssh_public_signing_key input
.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

Copy link

codecov bot commented Jun 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (bdcec1a) to head (4f2caa1).
⚠️ Report is 42 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #207   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          180       180           
  Branches        15        15           
=========================================
  Hits           180       180           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link

@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 @jmgate - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@jmgate jmgate merged commit d127a43 into master Jun 9, 2025
14 checks passed
@jmgate jmgate deleted the sign-release-commits-and-tags branch June 9, 2025 15:14
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.

1 participant