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

Dynamically set 'semver:' tag based on detected new/old versions #428

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions octo/builder_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Bumps %[1]s from ${{ steps.build-image.outputs.old-version }} to ${{ steps.build
"delete-branch": true,
"title": fmt.Sprintf("Bump %s from ${{ steps.build-image.outputs.old-version }} to ${{ steps.build-image.outputs.new-version }}", image),
"body": fmt.Sprintf("Bumps [`%[1]s`](https://%[1]s) from [`${{ steps.build-image.outputs.old-version }}`](https://%[1]s:${{ steps.build-image.outputs.old-version }}) to [`${{ steps.build-image.outputs.new-version }}`](https://%[1]s:${{ steps.build-image.outputs.new-version }}).", image),
"labels": "semver:minor, type:dependency-upgrade",
"labels": "${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade",
},
},
},
Expand Down Expand Up @@ -203,7 +203,7 @@ Bumps lifecycle from ${{ steps.lifecycle.outputs.old-version }} to ${{ steps.lif
"delete-branch": true,
"title": "Bump lifecycle from ${{ steps.lifecycle.outputs.old-version }} to ${{ steps.lifecycle.outputs.new-version }}",
"body": "Bumps `lifecycle` from `${{ steps.lifecycle.outputs.old-version }}` to `${{ steps.lifecycle.outputs.new-version }}`.",
"labels": "semver:minor, type:dependency-upgrade",
"labels": "${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion octo/buildpack_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Bumps %[1]s from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpa
"delete-branch": true,
"title": fmt.Sprintf("Bump %s from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}", d.Name),
"body": fmt.Sprintf("Bumps `%[1]s` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`.", d.Name),
"labels": "semver:minor, type:dependency-upgrade",
"labels": "${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion octo/package_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Bumps %[1]s from ${{ steps.package.outputs.old-version }} to ${{ steps.package.o
"delete-branch": true,
"title": fmt.Sprintf("Bump %s from ${{ steps.package.outputs.old-version }} to ${{ steps.package.outputs.new-version }}", name),
"body": fmt.Sprintf("Bumps [`%[1]s`](https://%[1]s) from [`${{ steps.package.outputs.old-version }}`](https://%[1]s:${{ steps.package.outputs.old-version }}) to [`${{ steps.package.outputs.new-version }}`](https://%[1]s:${{ steps.package.outputs.new-version }}).", name),
"labels": "semver:minor, type:dependency-upgrade",
"labels": "${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion octo/statik/statik.go

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions octo/update-build-image-dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,14 @@ update-build-image-dependency \
git add builder.toml
git checkout -- .

if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$NEW_VERSION" | awk -F '.' '{print $1}')" ]; then
LABEL="semver:major"
elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$NEW_VERSION" | awk -F '.' '{print $2}')" ]; then
LABEL="semver:minor"
else
LABEL="semver:patch"
fi

echo "::set-output name=old-version::${OLD_VERSION}"
echo "::set-output name=new-version::${NEW_VERSION}"
echo "::set-output name=version-label::${LABEL}"
9 changes: 9 additions & 0 deletions octo/update-buildpack-dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,14 @@ update-buildpack-dependency \
git add buildpack.toml
git checkout -- .

if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then
LABEL="semver:major"
elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then
LABEL="semver:minor"
else
LABEL="semver:patch"
fi

echo "::set-output name=old-version::${OLD_VERSION}"
echo "::set-output name=new-version::${VERSION}"
echo "::set-output name=version-label::${LABEL}"
9 changes: 9 additions & 0 deletions octo/update-lifecycle-dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,14 @@ update-lifecycle-dependency \
git add builder.toml
git checkout -- .

if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then
LABEL="semver:major"
elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then
LABEL="semver:minor"
else
LABEL="semver:patch"
fi

echo "::set-output name=old-version::${OLD_VERSION}"
echo "::set-output name=new-version::${VERSION}"
echo "::set-output name=version-label::${LABEL}"
9 changes: 9 additions & 0 deletions octo/update-package-dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,14 @@ fi

git checkout -- .

if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$NEW_VERSION" | awk -F '.' '{print $1}')" ]; then
LABEL="semver:major"
elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$NEW_VERSION" | awk -F '.' '{print $2}')" ]; then
LABEL="semver:minor"
else
LABEL="semver:patch"
fi

echo "::set-output name=old-version::${OLD_VERSION}"
echo "::set-output name=new-version::${NEW_VERSION}"
echo "::set-output name=version-label::${LABEL}"