name: Release Please
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
pr: ${{ steps.release.outputs.pr }}
steps:
- uses: googleapis/release-please-action@v5
id: release
with:
release-type: rust
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
auto-merge:
needs: release-please
if: ${{ needs.release-please.outputs.pr && !needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
steps:
- name: Enable auto-merge for Release PR
env:
GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
PR_NUMBER: ${{ fromJson(needs.release-please.outputs.pr).number }}
run: |
gh pr merge $PR_NUMBER --repo ${{ github.repository }} --auto --squash