From 1adaae1723c2e0fa9ac65143a1444bed3c6b10cb Mon Sep 17 00:00:00 2001 From: ItsNotGoodName Date: Tue, 7 Nov 2023 16:10:39 -0800 Subject: [PATCH] build(workflows): only run when changes --- .github/workflows/nightly.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5d38a1e..0b4aa76 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,7 +6,23 @@ on: workflow_dispatch: jobs: + check: + runs-on: ubuntu-22.04 + outputs: + nightly: ${{ steps.nightly.outputs.nightly }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - id: nightly + name: Check if current branch is nightly + run: (git tag --points-at HEAD | grep -wq "nightly" && echo "nightly=true") || echo "nightly=false" >> $GITHUB_OUTPUT + nightly: + needs: [check] + if: ${{ needs.check.outputs.nightly == 'false' }} permissions: contents: write runs-on: ubuntu-22.04