Skip to content

Commit 7bd6835

Browse files
committed
Build/Test Tools: Revert [59570].
The fix did not work properly and is causing performance data for commits to not be sent at all. It is therefore reverted until a proper solution has been implemented. See #62766. git-svn-id: https://develop.svn.wordpress.org/trunk@59571 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 5948245 commit 7bd6835

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/reusable-performance.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
# - Compare results.
9595
# - Add workflow summary.
9696
# - Set the base sha.
97+
# - Set commit details.
9798
# - Publish performance results.
9899
# - Ensure version-controlled files are not modified or deleted.
99100
performance:
@@ -311,12 +312,23 @@ jobs:
311312
const baseRef = await github.rest.git.getRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'tags/${{ env.BASE_TAG }}' });
312313
return baseRef.data.object.sha;
313314
315+
- name: Set commit details
316+
# Only needed when publishing results.
317+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
318+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
319+
id: commit-timestamp
320+
with:
321+
github-token: ${{ secrets.GITHUB_TOKEN }}
322+
script: |
323+
const commit_details = await github.rest.git.getCommit({ owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha });
324+
return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0))
325+
314326
- name: Publish performance results
315327
# Only publish results on pushes to trunk.
316328
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
317329
env:
318330
BASE_SHA: ${{ steps.base-sha.outputs.result }}
319-
COMMITTED_AT: $(git show -s $GITHUB_SHA --format="%cI")
331+
COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }}
320332
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
321333
HOST_NAME: "www.codevitals.run"
322334
run: |

0 commit comments

Comments
 (0)