Make WordPress Core


Ignore:
Timestamp:
01/06/2025 09:19:51 PM (4 months ago)
Author:
flixos90
Message:

Build/Test Tools: Fix incorrect commit time being reported to WordPress Code Vitals Dashboard.

2nd attempt of [59570].

Props mukesh27, ayeshrajans, swissspidy, desrosj.
Fixes #62766.

File:
1 edited

Legend:

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

    r59577 r59582  
    332332        # Only needed when publishing results.
    333333        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
    334         uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    335         id: commit-timestamp
    336         with:
    337           github-token: ${{ secrets.GITHUB_TOKEN }}
    338           script: |
    339             const commit_details = await github.rest.git.getCommit({ owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha });
    340             return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0))
     334        # Write to an environment variable to have the output available in later steps of the job.
     335        run: echo "COMMITTED_AT=$(git show -s $GITHUB_SHA --format='%cI')" >> $GITHUB_ENV
    341336
    342337      - name: Publish performance results
     
    345340        env:
    346341          BASE_SHA: ${{ steps.base-sha.outputs.result }}
    347           COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }}
    348342          CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
    349343          HOST_NAME: "www.codevitals.run"
Note: See TracChangeset for help on using the changeset viewer.