googleapis / release-please-action

automated releases based on conventional commits
Apache License 2.0
1.56k stars 200 forks source link

Fail job if PR isn't created #970

Open ACoolmanTelicent opened 2 months ago

ACoolmanTelicent commented 2 months ago

TL;DR

In some circumstances, the PR can fail to be created.

It would be nice if the Job failed

Note: We have many repos, and use the merging of a release candidate PR to deploy. If we don't get the PR and CI passes we are liable to not realise

Detailed design

This was my not-great™ fix

jobs:
  create-release-pr:
    runs-on: ubuntu-latest
    steps:
      - uses: google-github-actions/release-please-action@v3 # v3 as we are still on node 18 in this repo
        with:
          release-type: node
          package-name: release-please-action
          prerelease: false

+      - name: Check for Malformed Commit Messages
+        run: |
+          if echo "${{ steps.release-please.outputs.logs }}" | grep -q "commit could not be parsed"; then
+            echo "Malformed commit message found"
+            exit 1
+          fi

Additional information

No response