Skip to content

fix: add missing reusable release workflows #2

fix: add missing reusable release workflows

fix: add missing reusable release workflows #2

name: Publish Release
on:
workflow_call:
secrets:
GITHUB_TOKEN:

Check failure on line 6 in .github/workflows/reusable-publish-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/reusable-publish-release.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
jobs:
publish-release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'release:')
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract Tag Name
id: extract_tag
run: |
TITLE="${{ github.event.pull_request.title }}"
TAG_NAME=$(echo "$TITLE" | sed 's/release: //')
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
VERSION_TITLE=${TAG_NAME#v}
echo "VERSION_TITLE=$VERSION_TITLE" >> $GITHUB_ENV
- name: Create Release Body File
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: echo "$PR_BODY" > release_body.md
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ env.TAG_NAME }} \
--title "${{ env.VERSION_TITLE }}" \
--notes-file release_body.md \
--verify-tag