Skip to content

[pre-commit.ci] pre-commit autoupdate #107

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #107

name: Display the version hint
on:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
branches: [master]
jobs:
bumpversion:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout the repository
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.PAT }}
- name: Setup Python and Git
uses: ./.github/actions/setup-python-and-git
with:
python-version: '3.11'
- name: Install requirements
run: |
python -m pip install . bump-my-version
- name: Get the changelog and release hint
id: changelog
# uses: callowayproject/generate-changelog@master
uses: ./
with:
branch_override: ${{ github.base_ref }}
skip_output_pipeline: True
- name: Bump version dry run
if: ${{ steps.changelog.outputs.release_hint != 'no-release' }}
shell: bash
run: |
PR_NUMBER=$(gh pr view --json number -q .number || echo "")
REVISION=$(git describe --tags --long | awk -F- '{print $2}')
RELEASE_KIND="${{ steps.changelog.outputs.release_hint }}"
export PR_NUMBER REVISION RELEASE_KIND
# This will display a full log of what would happen if we were to bump the version.
bump-my-version bump --dry-run --verbose "$RELEASE_KIND"
# This retrieves the current and new version numbers as a JSON-formatted string.
VERSION_INFO=$(bump-my-version show --format json --increment "$RELEASE_KIND" current_version new_version)
echo "CURRENT_VERSION=$(echo $VERSION_INFO | jq -r .current_version)" >> $GITHUB_ENV
echo "NEW_VERSION=$(echo $VERSION_INFO | jq -r .new_version)" >> $GITHUB_ENV
- name: Set no-release information
if: ${{ steps.changelog.outputs.release_hint == 'no-release' }}
run: |
echo "CURRENT_VERSION=$(bump-my-version show current_version)" >> $GITHUB_ENV
echo "NEW_VERSION=$(bump-my-version show current_version)" >> $GITHUB_ENV
- name: Display the version hint
uses: s-gehring/singleton-comment@v1
with:
comment-body: |
**Version hint:** ${{ steps.changelog.outputs.release_hint }}
**Current version:** ${{ env.CURRENT_VERSION }}
**New version (when merged):** ${{ env.NEW_VERSION }}