Skip to content

Commit

Permalink
ci: add inline comments to describe the "Get SDK Version" job logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ctran88 committed Jan 27, 2025
1 parent 93010f3 commit 9a5448b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ jobs:
if: ${{ steps.check_permission.outputs.require-result == 'true' }}
run: |
line=$(head -n 1 go.mod)
go_mod_version=${line##*/v}
manifest_version=$(jq -r '."."' .release-please-manifest.json | cut -d. -f1)
go_mod_major_version=${line##*/v}
manifest_major_version=$(jq -r '."."' .release-please-manifest.json | cut -d. -f1)
# Only set version if the go.mod major version was bumped in the PR
# meaning that an override for the local registry should be set to make it work in e2es
version=''
if [[ $go_mod_version -gt $manifest_version ]]; then
version="${go_mod_version}.0.0"
if [[ $go_mod_major_version -gt $manifest_major_version ]]; then
version="${go_mod_major_version}.0.0"
fi
echo "version=$version" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 9a5448b

Please sign in to comment.