on main help sign in
ci: only build nightlies if there are something to build (#126)
d34161bCarlos Alexandro Becker
.github/workflows/nightly.yml+18
@@ -6,7 +6,25 @@ on:
6 workflow_dispatch: # allows manual triggering
6 workflow_dispatch: # allows manual triggering
7
7
8jobs:
8jobs:
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
9 nightly:
26 nightly:
27+ needs: check
10 uses: charmbracelet/meta/.github/workflows/nightly.yml@main
28 uses: charmbracelet/meta/.github/workflows/nightly.yml@main
11 secrets:
29 secrets:
12 goreleaser_key: ${{ secrets.GORELEASER_KEY }}
30 goreleaser_key: ${{ secrets.GORELEASER_KEY }}