honeybadger-io/honeybadger-laravel

View on GitHub
.github/workflows/release.yml

Summary

Maintainability
Test Coverage
name: Release package

on:
  workflow_dispatch:
  workflow_run:
    workflows: [Run Tests]
    types: [completed]
    branches: [master]

permissions:
  contents: write
  pull-requests: write

jobs:
  release-if-needed:
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    runs-on: ubuntu-latest
    steps:
      - name: Create Release PR
        uses: googleapis/release-please-action@v4
        id: release
        with:
          release-type: php

      - name: Checkout
        if: ${{ steps.release.outputs.prs_created == 'true' }}
        uses: actions/checkout@v4
        with:
          ref: ${{ fromJSON(steps.release.outputs.pr).headBranchName }}

      - name: Update version in HoneybadgerLaravel.php
        if: ${{ steps.release.outputs.prs_created == 'true' }}
        run: php scripts/SyncSourceCodeWithPackageVersion.php "${{ fromJSON(steps.release.outputs.pr).title }}"

      - uses: stefanzweifel/git-auto-commit-action@v5
        if: ${{ steps.release.outputs.prs_created == 'true' }}
        with:
          create_branch: false
          commit_message: "chore: update version"
          commit_user_name: "honeybadger-robot"
          commit_user_email: "honeybadger-robot@honeybadger.io"