From 07ec67dd92a1869070be3ab8b82a96af6342355e Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 6 Jan 2025 09:39:29 +0530 Subject: [PATCH] Add ENV var step --- .github/workflows/reusable-performance.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-performance.yml b/.github/workflows/reusable-performance.yml index c9dad187499ce..f7da1aa131f5d 100644 --- a/.github/workflows/reusable-performance.yml +++ b/.github/workflows/reusable-performance.yml @@ -94,6 +94,7 @@ jobs: # - Compare results. # - Add workflow summary. # - Set the base sha. + # - Set commit details. # - Publish performance results. # - Ensure version-controlled files are not modified or deleted. performance: @@ -311,12 +312,20 @@ jobs: const baseRef = await github.rest.git.getRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'tags/${{ env.BASE_TAG }}' }); return baseRef.data.object.sha; + - name: Test commit details + # Only needed when publishing results. + run: echo "COMMITTED_AT_TEST=$(git show -s $GITHUB_SHA --format='%cI')" >> $GITHUB_ENV + + - name: Set commit details + # Only needed when publishing results. + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }} + run: echo "COMMITTED_AT=$(git show -s $GITHUB_SHA --format='%cI')" >> $GITHUB_ENV + - name: Publish performance results # Only publish results on pushes to trunk. if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }} env: BASE_SHA: ${{ steps.base-sha.outputs.result }} - COMMITTED_AT: $(git show -s $GITHUB_SHA --format="%cI") CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }} HOST_NAME: "www.codevitals.run" run: |