Skip to content

Fix role consistency when empty list #14

Fix role consistency when empty list

Fix role consistency when empty list #14

---
name: Create Release Tag
permissions:
contents: write
pull-requests: read
on:
pull_request:
types: ['closed']
branches:
- 'main'
concurrency:
group: 'create-release-${{ github.head_ref }}'
cancel-in-progress: true
jobs:
build:
name: 🏷️ Create Release Tag
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release-prep/')
runs-on: ubuntu-latest
steps:
- name: Get branch name
run: |
branch_name="${{ github.event.pull_request.head.ref }}"
echo "TAG_NAME=${branch_name#release-prep/}" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v7.0.1
with:
github-token: ${{ github.token }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{ env.TAG_NAME }}',
sha: context.sha
})