Skip to content

Create tag for release #75

Create tag for release

Create tag for release #75

Workflow file for this run

name: Create tag for release
on:
pull_request:
types:
- closed
workflow_dispatch:
inputs:
commit:
description: 'Commit hash'
required: true
type: string
jobs:
create-tag:
if: >-

Check failure on line 15 in .github/workflows/create-tag.yml

View workflow run for this annotation

GitHub Actions / Create tag for release

Invalid workflow file

The workflow is not valid. .github/workflows/create-tag.yml (Line: 15, Col: 9): Unexpected symbol: 'github'. Located at position 26 within expression: (inputs.commit || false) github.event.pull_request.merged == true && github.event.pull_request.user.login == 'github-actions' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && startsWith(github.event.pull_request.head.ref, 'bump-version')
(inputs.commit || false)
github.event.pull_request.merged == true &&
github.event.pull_request.user.login == 'github-actions' &&
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name &&
startsWith(github.event.pull_request.head.ref, 'bump-version')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout to the input commit
run: |
if [[ -z "${{ inputs.commit }}" ]]; then
COMMIT="${{ inputs.commit }}"
else
COMMIT=git rev-parse ${{ github.sha }}^@ | grep -Fvx ${{ github.event.pull_request.head.sha }}
fi
git checkout $COMMIT
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Extract version
run: |
echo "version=$(cargo pkgid -p bindgen | cut -d '#' -f 2)" >> $GITHUB_ENV
- name: Create tag
run: |
TAG_NAME="v${{ env.version }}"
git tag -s $TAG_NAME
git push origin $TAG_NAME