From 78e8316cf0b17e626551d326695b9b72aee27789 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Tue, 7 Jan 2025 00:11:24 +0800 Subject: [PATCH] DEV: Simplify `if` conditional for flaky test report steps (#30579) The previous conditionals was just more complex and harder to understand. --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f08fd9383ec..04f87cef3b3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -314,7 +314,7 @@ jobs: - name: Check for flaky tests report id: check-flaky-spec-report - if: always() && github.repository == 'discourse/discourse' && ${{ env.DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS == '1' }} + if: github.repository == 'discourse/discourse' && env.DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS == '1' run: | if [ -f tmp/turbo_rspec_flaky_tests.json ]; then echo "exists=true" >> $GITHUB_OUTPUT @@ -325,18 +325,18 @@ jobs: - name: Fetch Job ID id: fetch-job-id - if: always() && steps.check-flaky-spec-report.outputs.exists == 'true' + if: steps.check-flaky-spec-report.outputs.exists == 'true' run: | job_id=$(ruby script/get_github_workflow_run_job_id.rb ${{ github.run_id }} ${{ github.run_attempt }} '${{ matrix.target }} ${{ matrix.build_type }}') echo "job_id=$job_id" >> $GITHUB_OUTPUT - name: Create flaky tests report artifact - if: always() && steps.check-flaky-spec-report.outputs.exists == 'true' + if: steps.check-flaky-spec-report.outputs.exists == 'true' run: cp tmp/turbo_rspec_flaky_tests.json tmp/turbo_rspec_flaky_tests-${{ matrix.build_type }}-${{ matrix.target }}-${{ steps.fetch-job-id.outputs.job_id }}.json - name: Upload flaky tests report uses: actions/upload-artifact@v4 - if: always() && steps.check-flaky-spec-report.outputs.exists == 'true' + if: steps.check-flaky-spec-report.outputs.exists == 'true' with: name: flaky-test-reports-${{ matrix.build_type }}-${{ matrix.target }} path: tmp/turbo_rspec_flaky_tests-${{ matrix.build_type }}-${{ matrix.target }}-${{ steps.fetch-job-id.outputs.job_id }}.json