on main help sign in
ci: only build nightlies if there are something to build (#126)

this should save us a bit of actions money

commitd34161b9e77b6d7914f351f8c675e8ee7953de02 authorCarlos Alexandro Becker <caarlos0@users.noreply.github.com> dateThu 10 Jul 2025, 13:40 (1 year ago) parentb0c9517
1 file changed+18
.github/workflows/nightly.yml+18
.github/workflows/nightly.yml+18
@@ -6,7 +6,25 @@ on:
66 workflow_dispatch: # allows manual triggering
77
88jobs:
9+ check:
10+ runs-on: ubuntu-latest
11+ outputs:
12+ should_run: ${{ steps.check.outputs.should_run }}
13+ steps:
14+ - uses: actions/checkout@v4
15+ with:
16+ fetch-depth: 1
17+ - id: check
18+ env:
19+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
20+ run: |
21+ if gh run list --workflow nightly.yml -c $(git rev-parse HEAD) -s success | grep 'completed'; then
22+ echo "should_run=false" >> $GITHUB_OUTPUT
23+ else
24+ echo "should_run=true" >> $GITHUB_OUTPUT
25+ fi
926 nightly:
27+ needs: check
1028 uses: charmbracelet/meta/.github/workflows/nightly.yml@main
1129 secrets:
1230 goreleaser_key: ${{ secrets.GORELEASER_KEY }}