From 4a991a20a5a1c143b62ed36389702d3491f654ad 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..b2683b8 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,10 +6,26 @@ on: workflow_dispatch: jobs: + check: + runs-on: ubuntu-22.04 + outputs: + nightly: ${{ steps.check.nightly.nightly }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - 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: permissions: contents: write runs-on: ubuntu-22.04 + if: ${{ needs.check.outputs.nightly != 'true' }} steps: - name: Checkout uses: actions/checkout@v4