From 0f27ed4c0fac9aad75b017aa5f99214ce411fafa Mon Sep 17 00:00:00 2001 From: jessicasyu <15913767+jessicasyu@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:59:47 -0400 Subject: [PATCH] Update workflows to only create badges on main --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 427928a..f416425 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,7 +83,7 @@ jobs: clean: false result: - if: ${{ always() }} + if: ${{ always() && github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 74af6ac..b4eac0f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -54,6 +54,26 @@ jobs: source .venv/bin/activate mypy src + result: + if: ${{ always() && github.ref == 'refs/heads/main' }} + + runs-on: ubuntu-latest + + needs: [lint] + + steps: + + - name: Checkout the repo + uses: actions/checkout@v4 + + - name: Get lint result + run: | + if [[ ${{ needs.lint.result }} == "success" || ${{ needs.lint.result }} == "skipped" ]]; then + exit 0 + else + exit 1 + fi + - name: Generate passing badge if: success() uses: knightdave/anybadge-action@v1.1.0