name: Release after PR to main on: pull_request: branches: - main types: [closed] jobs: release: runs-on: ubuntu-latest if: ${{ github.event.pull_request.merged }} steps: - name: Checkout uses: actions/checkout@v2 - name: Get Version from package.json id: version uses: notiz-dev/github-action-json-property@release with: path: 'package.json' prop_path: 'version' - name: Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{secrets.gh_token}} with: tag_name: v${{steps.version.outputs.prop}} release_name: Release ${{steps.version.outputs.prop}} body: ${{ github.event.pull_request.body }} draft: false prerelease: false