From c741dacc583f5e958ea7741a585290b78681dc3e Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Mon, 7 Oct 2024 15:06:14 +0300 Subject: [PATCH] ci: Only run mutants workflow under certain conditions And simplify the per-step conditions accordingly. --- .github/workflows/mutants.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mutants.yml b/.github/workflows/mutants.yml index 3957392c1..e9fe3a9af 100644 --- a/.github/workflows/mutants.yml +++ b/.github/workflows/mutants.yml @@ -17,6 +17,7 @@ permissions: jobs: mutants: + if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -51,18 +52,16 @@ jobs: echo 'TITLE=All Mutants' >> "$GITHUB_ENV" - name: Post step summary - if: always() run: | { echo "### $TITLE" echo "See https://mutants.rs/using-results.html for more information." echo '```' - sed 's/\x1b\[[0-9;]*[mGKHF]//g' results.txt + sed 's/\x1b\[[0-9;]*[mGKHF]//g' results.txt || true echo '```' } > "$GITHUB_STEP_SUMMARY" - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 - if: always() with: name: mutants.out path: mutants.out