Make WordPress Core

Changeset 58767


Ignore:
Timestamp:
07/19/2024 01:13:49 PM (3 months ago)
Author:
desrosj
Message:

Build/Test Tools: Ensure TARGET_SHA is set for older branches.

The workflow_dispatch event payload does not contain the before property containing the previous commit’s SHA value, which causes scheduled runs of the performance testing workflow in older branches to fail.

This adds a step specifically for this event type to use native Git commands to retrieve the required SHA value instead.

Props joemcgill.
Fixes #61699.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/reusable-performance.yml

    r58270 r58767  
    5555  # - Configure environment variables.
    5656  # - Checkout repository.
     57  # - Determine the target SHA value (on `workflow_dispatch` only).
    5758  # - Set up Node.js.
    5859  # - Log debug information.
     
    110111        with:
    111112          show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
     113          fetch-depth: ${{ github.event_name == 'workflow_dispatch' && '2' || '1' }}
     114
     115      # The `workflow_dispatch` event is the only one missing the needed SHA to target.
     116      - name: Retrieve previous commit SHA (if necessary)
     117        if: ${{ github.event_name == 'workflow_dispatch' }}
     118        run: echo "TARGET_SHA=$(git rev-parse HEAD^1)" >> $GITHUB_ENV
    112119
    113120      - name: Set up Node.js
Note: See TracChangeset for help on using the changeset viewer.