Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup steps after release-please to automate gem version syncing #208

Closed
wants to merge 2 commits into from

Commits on May 3, 2024

  1. Setup steps after release-please to automate gem version syncing

    This is an attempt to automatically sync our gem versions after
    release-please detects the need to bump the version. It will open up a
    PR with that new version bump to judoscale-ruby and changelog added, and
    these extra steps should follow-up that with syncing the new version
    across the other libraries.
    
    I have done some manual testing on this using a separate branch, by
    commenting out the release-please and "if" statements, and only
    triggering these actual steps that sync versions and push a new commit.
    By bumping the judoscale-ruby version myself in a commit, the automated
    steps here would generate a new follow-up commit automatically syncing
    the other gems versions, so I'm hopeful this will work as expected.
    (famous last words)
    
    The git user name/email and commands in general are based on examples:
    https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token
    https://github.com/google-github-actions/release-please-action/tree/v3.7.13?tab=readme-ov-file#creating-majorminor-tags
    carlosantoniodasilva committed May 3, 2024
    Configuration menu
    Copy the full SHA
    daeb3be View commit details
    Browse the repository at this point in the history

Commits on May 6, 2024

  1. Checkout the PR head branch name where we need to sync

    We need to checkout the release PR to sync versions, otherwise it might
    use `main` which is where this workflow is running.
    
    It seems the "outputs" object has access to a PR object if one was
    created (which it'd have been in this case):
    https://github.com/google-github-actions/release-please-action?tab=readme-ov-file#outputs
    
    and that PR object has access to both head & base branch names:
    https://github.com/googleapis/release-please/blob/cb106cd0b5ae5c3e2a3b015487dc615eba72b842/src/pull-request.ts#L15-L17
    
    so I believe we can checkout the right branch for that PR and run the
    sync/commit there, with this change.
    
    It's hard to test all of this without actually running a release though,
    so we might have to wait and see! (and hope!)
    carlosantoniodasilva committed May 6, 2024
    Configuration menu
    Copy the full SHA
    4c06977 View commit details
    Browse the repository at this point in the history