name: Create Release Notes

on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    name: Create Release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - id: prep
        run: |
          release_version=$(echo ${{ github.ref }} | sed -e 's/[^0-9]//g')
          echo "::set-output name=release_version::$release_version"
      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: ${{ github.ref }}
          body:
            'Release notes: https://wvlet.org/airframe/docs/release-notes#${{ steps.prep.outputs.release_version }}'
          draft: false
          prerelease: false

Add a GitHub Action for creating release note links
internal: Add a GitHub Action for creating release note links
