Skip to content

ci: create-pr-new-release.yml - fix workflow input type #10

ci: create-pr-new-release.yml - fix workflow input type

ci: create-pr-new-release.yml - fix workflow input type #10

name: Create new release
on:
pull_request:
branches:
- main
types:
- closed
jobs:
push-tag:
if: ${{ contains(github.event.pull_request.labels.*.name, 'version update') && github.event.pull_request.merged }}
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.value }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install
- name: Configure git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Push a tag
id: tag
run: |
tag="v$(hatch version)"
git tag -a ${tag} -m "New release ${tag} (tagged by github-actions[bot])"
git push origin ${tag}
echo "value=${tag}" >> $GITHUB_OUTPUT
create-release:
runs-on: ubuntu-latest
needs: push-tag
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create a release
uses: elgohr/Github-Release-Action@v5
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: ${{ steps.tag.outputs.value }}
tag: ${{ steps.tag.outputs.value }}