Fix/DEI-129 version number input file (#55) #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Python Poetry packages | |
on: | |
push: | |
branches: | |
- main | |
env: | |
# The version type to update, based on the commit message (either patch for bug/fix or minor for all other commits) | |
VERSION_TYPE: ${{ (startsWith(github.event.head_commit.message, 'Fix') || | |
startsWith(github.event.head_commit.message, 'fix') || | |
startsWith(github.event.head_commit.message, 'Bug') || | |
startsWith(github.event.head_commit.message, 'bug')) && | |
'patch' || 'minor' }} | |
jobs: | |
update-packages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Run image | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.4.2 | |
- name: bump up patch version and update version in template_input.yaml | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
poetry version ${{ env.VERSION_TYPE }} | |
PROJECT_VERSION=$(poetry version --short) | |
sed -i "1 s/.*/version: $PROJECT_VERSION/" template_input.yaml | |
git add template_input.yaml | |
git add pyproject.toml | |
git commit -m "bump up ${{ env.VERSION_TYPE }} version from workflow: version $PROJECT_VERSION" | |
git push |