Skip to content

.github/workflows/on_release.yaml #7

.github/workflows/on_release.yaml

.github/workflows/on_release.yaml #7

Workflow file for this run

on:
release:
types: [published]
jobs:
change_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update version in pyproject.toml
run: |
tag_name=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//')
sed -i "s/version = .*/version = '${tag_name}'/" pyproject.toml
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add ./pyproject.toml
git commit -m "Update version to ${tag_name}"
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
continue-on-error: true
with:
branch: main
github_token: ${{ github.token }}