Skip to content

Commit

Permalink
Sort the commit timestamp getter action
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Feb 28, 2023
1 parent 43acd1c commit 6971dec
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ jobs:
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
if: github.event_name == 'push'
id: commit-timestamp
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const commit_details = await github.rest.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha});
return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0))
- name: Compare performance with custom branches
if: github.event_name == 'workflow_dispatch'
env:
Expand All @@ -103,6 +94,16 @@ jobs:
run: |
./bin/plugin/cli.js perf $(echo $BRANCHES | tr ',' ' ') --tests-branch $GITHUB_SHA --wp-version "$WP_VERSION"
- name: Get commit timestamp
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
if: github.event_name == 'push'
id: commit-timestamp
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const commit_details = await github.rest.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha});
return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0))
- name: Publish performance results
if: github.event_name == 'push'
env:
Expand Down

0 comments on commit 6971dec

Please sign in to comment.