Build/Test Tools: Don’t run the performance workflow when branching.

When a branch is created, there is no previous commit to reference in the `github.event.before` context, which causes the performance workflow to fail because there is no previous commit to perform a comparison with.

This adds a condition to check that `github.event.before` is not set to `0000000000000000000000000000000000000000`, which is the default value when there are no previous commits.

Props swissspidy.
See #588867.

git-svn-id: https://develop.svn.wordpress.org/trunk@56972 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2023-10-19 13:59:01 +00:00
parent 2a6b527f73
commit 3850ddca39

View File

@ -92,7 +92,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( '00000000', github.event.before ) }}
steps:
- name: Configure environment variables