From daa73d294a59e3ab87cf4b51225c562d8fcea7a2 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Fri, 11 Oct 2024 19:02:30 +0000 Subject: [PATCH] Build/Test Tools: Fix Performance Test workflows on release branches. This fixes an issue after [59170] that was causing the Performance Test workflows to fail on older branches since the `CODEVITALS_PROJECT_TOKEN` input value was marked as required but was not being passed. This is a follow-up to [59214] and [59215]. Fixes #62153. Props desrosj, joemcgill, flixos90, swissspidy. git-svn-id: https://develop.svn.wordpress.org/trunk@59217 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/reusable-performance.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-performance.yml b/.github/workflows/reusable-performance.yml index 4f6ba046311ac..814e7b95b8d10 100644 --- a/.github/workflows/reusable-performance.yml +++ b/.github/workflows/reusable-performance.yml @@ -29,7 +29,7 @@ on: secrets: CODEVITALS_PROJECT_TOKEN: description: 'The authorization token for https://www.codevitals.run/project/wordpress.' - required: true + required: false env: PUPPETEER_SKIP_DOWNLOAD: ${{ true }} @@ -329,7 +329,12 @@ jobs: COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }} CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }} HOST_NAME: "www.codevitals.run" - run: node ./tests/performance/log-results.js $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT $HOST_NAME + run: | + if [ -z "$CODEVITALS_PROJECT_TOKEN" ]; then + echo "Performance results could not be published. 'CODEVITALS_PROJECT_TOKEN' is not set" >> $GITHUB_OUTPUT + exit 1 + fi + node ./tests/performance/log-results.js $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT $HOST_NAME - name: Ensure version-controlled files are not modified or deleted run: git diff --exit-code