mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-22 20:03:04 +00:00
skip_changelog: More fixes to version bumper
* Check for remote branch before trying to build a changeset. * Fail exit if push fails. * Add pull-request permission to workflow. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
parent
c05bc042ba
commit
2293e7f178
2 changed files with 10 additions and 2 deletions
11
.github/scripts/version_updater.sh
vendored
11
.github/scripts/version_updater.sh
vendored
|
@ -81,6 +81,13 @@ yq eval -i ".argument_specs.main.options.${role}_version.default = \"${version}\
|
|||
|
||||
update_branch="autoupdate/${role}/${version}"
|
||||
|
||||
remote_branch="$(github_api "repos/${GIT_REPO}/branches/${update_branch}" | jq -r .name)"
|
||||
|
||||
if [[ -n "${remote_branch}" ]] ; then
|
||||
echo_yellow "Branch is already on remote."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Push new version
|
||||
git config user.email "${GIT_MAIL}"
|
||||
git config user.name "${GIT_USER}"
|
||||
|
@ -92,8 +99,8 @@ git add \
|
|||
git commit -m 'patch: :tada: automated upstream release update'
|
||||
echo_green "Pushing to ${update_branch} branch in ${role}"
|
||||
if ! git push "https://${GITHUB_TOKEN}:@github.com/${GIT_REPO}" --set-upstream "${update_branch}"; then
|
||||
echo_yellow "Branch is already on remote."
|
||||
exit 0
|
||||
echo_yellow "Branch push failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! post_pull_request \
|
||||
|
|
1
.github/workflows/version_bumper.yml
vendored
1
.github/workflows/version_bumper.yml
vendored
|
@ -27,6 +27,7 @@ jobs:
|
|||
needs: discover-role-repos
|
||||
permissions:
|
||||
contents: write
|
||||
pull-request: write
|
||||
container:
|
||||
image: quay.io/prometheus/golang-builder:base
|
||||
env:
|
||||
|
|
Loading…
Reference in a new issue