Skip to content

refactor: Adopt release-please and streamline release workflow #1

refactor: Adopt release-please and streamline release workflow

refactor: Adopt release-please and streamline release workflow #1

name: Create Release
on:
pull_request:
types: [closed]
permissions:
contents: write
jobs:
create-tag:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'autorelease: pending')

Check failure on line 13 in .github/workflows/create-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create-release.yml

Invalid workflow file

You have an error in your yaml syntax on line 13
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from PR title
id: version
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
VERSION=$(echo "$PR_TITLE" | grep -oP 'v\d+\.\d+\.\d+' || echo "")
if [[ -z "$VERSION" ]]; then
echo "No version found in PR title"
exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create and push tag
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$VERSION" -m "Release $VERSION"
git push origin "$VERSION"