From a0926122fecfbc773aefd8cbca344c1158a58428 Mon Sep 17 00:00:00 2001 From: Arvin Singla Date: Fri, 3 May 2024 11:04:46 -0400 Subject: [PATCH] Testing if we skip running the test [SKIP TEST] --- .github/workflows/e2e-test.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index ccf3cc157..4c5ede547 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -6,7 +6,26 @@ env: GITHUB_TOKEN: ${{ github.token }} jobs: + check_commit: + runs-on: ubuntu-latest + outputs: + skip: ${{ steps.check.outputs.skip }} + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Check commit message + id: check + run: | + MESSAGE=$(git log --format=%B -n 1 ${{ github.event.after }}) + if [[ "$MESSAGE" == *"[SKIP TEST]"* ]]; then + echo "Commit message contains [SKIP TEST]. Skipping tests." + echo "::set-output name=skip::true" + else + echo "::set-output name=skip::false" + fi e2e-test-run: + needs: check_commit + if: needs.check_commit.outputs.skip == 'false' runs-on: ubuntu-latest steps: - name: Checkout repository