Make WordPress Core

Changeset 59582


Ignore:
Timestamp:
01/06/2025 09:19:51 PM (7 days 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.

Location:
trunk
Files:
2 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"
  • trunk/tests/performance/log-results.js

    r59577 r59582  
    1212 */
    1313const https = require( 'https' );
    14 const [ token, branch, hash, baseHash, timestamp, host ] =
     14const [ token, branch, hash, baseHash, date, host ] =
    1515    process.argv.slice( 2 );
    1616const { median, parseFile, accumulateValues } = require( './utils' );
     
    8888        hash,
    8989        baseHash,
    90         timestamp: parseInt( timestamp, 10 ),
     90        timestamp: date,
    9191        metrics: metrics,
    9292        baseMetrics: baseMetrics,
Note: See TracChangeset for help on using the changeset viewer.