name: Versioning and Tagging (release-please)

on:
  workflow_dispatch:
  pull_request:
    types:
      - closed
    branches:
      - "releases/**"
      - "master"
      - "main"

permissions:
  contents: write
  pull-requests: write

jobs:
  release-please:
    # only run this job if the PR was merged
    if: (github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch')
    runs-on: ubuntu-latest
    steps:
      - uses: googleapis/release-please-action@v4
        with:
          token: ${{ secrets.ACTION_ACCESS_TOKEN }}
          # this is a built-in strategy in release-please, see "Action Inputs"
          # for more options
          release-type: node
