Skip to content

Conversation

@0marperez
Copy link
Contributor

@0marperez 0marperez commented Nov 17, 2025

Issue #, if available:
N/A

Description of changes:
Allows us to create repo tools version bumps in downstream repos via our release workflow.
Example PRs:
aws/aws-sdk-kotlin#1734
aws/aws-sdk-kotlin#1734
aws/aws-crt-kotlin#210

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@0marperez 0marperez marked this pull request as ready for review November 17, 2025 23:31
@0marperez 0marperez requested a review from a team as a code owner November 17, 2025 23:31
type: boolean
required: false
default: false
description: 'Whether to create an CRT Kotlin version bump pull request for this release'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: "an CRT" → "a CRT"


- name: AWS SDK Kotlin pull request
if: ${{ inputs.sdk-version-bump == 'true' }}
uses: aws/aws-kotlin-repo-tools/.github/actions/version-bump-pr@main
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: We should use the syntax for actions in the same repository:

uses: ./.github/actions/version-bump-pr

Comment on lines 38 to 48
if [ "${{ inputs.kn-release }}" == "true" ]; then
CURRENT_VERSION=$(git tag --sort=-creatordate | grep -- '-kn$' | head -n 1)
else
CURRENT_VERSION=$(git tag --sort=-creatordate | grep -v -- '-kn$' | head -n 1)
fi
CURRENT_VERSION=$(git tag --sort=-creatordate | grep -- '-kn$' | head -n 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Correctness: This retains the old logic for determining the previous K/N version number, which is not what we want. Since we're not cutting -kn releases anymore, we should probably just remove the grep filter altogether:

CURRENT_VERSION=$(git tag --sort=-creatordate | head -n1)

Comment on lines 102 to 107
- name: Delete failed release tag
if: ${{ failure() }}
run: |
git push --delete origin ${{ steps.resolve-new-version.outputs.NEW_VERSION }}
if [ "${{ steps.release-job.outcome }}" != "success" ]; then
git push --delete origin ${{ steps.resolve-new-version.outputs.NEW_VERSION }}
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Move the bash if up into the step if: by using failure with conditions:

- name: Delete failed release tag
  if: ${{ failure() && steps.release-job.outcome != 'success' }}
  run: |
    git push --delete origin ${{ steps.resolve-new-version.outputs.NEW_VERSION }}

Comment on lines 35 to 36
git branch $BRANCH
git checkout $BRANCH
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can be simplified:

git checkout -b $BRANCH

Comment on lines 25 to 53
- name: Create pull request
shell: bash
env:
REPO: ${{ inputs.repo }}
NEW_VERSION: ${{ inputs.version }}
GH_TOKEN: ${{ inputs.pat }}
run: |
BRANCH=repo-tools-$NEW_VERSION
cd $REPO
git branch $BRANCH
git checkout $BRANCH
git config user.name aws-sdk-kotlin-ci
git config user.email "[email protected]"
sed -i "s/aws-kotlin-repo-tools-version = .*/aws-kotlin-repo-tools-version = \"$NEW_VERSION\"/" gradle/libs.versions.toml
git add gradle/libs.versions.toml
git commit -m "misc: repo tools v$NEW_VERSION"
git push --force --set-upstream origin $BRANCH
EXISTING_PR=$(gh pr list --head "$BRANCH" --state open --json number -q '.[0].number')
if [ -z "$EXISTING_PR" ]; then
PR_URL=$(gh pr create --title "misc: repo tools v$NEW_VERSION" --body "Bumps repo tools to v$NEW_VERSION")
PR_NUMBER=$(basename $PR_URL)
gh pr edit $PR_NUMBER --add-label "no-changelog"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: It would be nice to see some logs from this action which could assist in debugging. Offhand, I might suggest dumping the libs.versions.toml file after modification, showing the URLs to the new or existing PRs, emitting a warning when the user checked the box for a repo but that repo already has an open PR, etc.

@0marperez 0marperez merged commit 825d70a into main Nov 19, 2025
7 checks passed
@0marperez 0marperez deleted the automate-repo-tools-version-bump branch November 19, 2025 18:05
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