From d34161b9e77b6d7914f351f8c675e8ee7953de02 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 10 Jul 2025 13:40:43 -0300 Subject: [PATCH] ci: only build nightlies if there are something to build (#126) this should save us a bit of actions money --- .github/workflows/nightly.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1e271bbb6e180557b241a6ab5e40acf7b82705df..fdc2d260570dd0acb7abe0d5371bed32b05b29f2 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,7 +6,25 @@ on: workflow_dispatch: # allows manual triggering jobs: + check: + runs-on: ubuntu-latest + outputs: + should_run: ${{ steps.check.outputs.should_run }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - id: check + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + run: | + if gh run list --workflow nightly.yml -c $(git rev-parse HEAD) -s success | grep 'completed'; then + echo "should_run=false" >> $GITHUB_OUTPUT + else + echo "should_run=true" >> $GITHUB_OUTPUT + fi nightly: + needs: check uses: charmbracelet/meta/.github/workflows/nightly.yml@main secrets: goreleaser_key: ${{ secrets.GORELEASER_KEY }}