From 8ffa0e802b5b44a158f54a65ee4dc712a02b4bfc Mon Sep 17 00:00:00 2001 From: sgoudham Date: Mon, 24 Jul 2023 22:58:31 +0100 Subject: [PATCH] ci(typos): custom step to exit --- .github/workflows/typos.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index 79b1ff2..4d52c68 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -14,9 +14,16 @@ jobs: uses: actions/checkout@v3 - uses: crate-ci/typos@master + id: typos continue-on-error: true - # We don't want this check to fail on `main` but continue to fail on PRs - - name: Successfully Exit When Branch 'main' + # 'continue-on-error' will always succeed, we should exit based on the outcome and not the conclusion + # ref: https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context + - name: Fail When Typos Are Found in Pull Request + if: ${{ github.repository == 'catppuccin/userstyles' && github.event_name == 'pull_request' && steps.typos.outcome != 'success' }} + run: "exit 1" + + # We always want this check to pass on branch 'main' but continue to fail on PRs + - name: Pass When Branch 'main' if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }} run: "exit 0"