nightly.yml 920 B

12345678910111213141516171819202122232425262728293031
  1. name: nightly
  2. on:
  3. schedule:
  4. - cron: "0 0 * * *" # every day at midnight
  5. workflow_dispatch: # allows manual triggering
  6. jobs:
  7. check:
  8. runs-on: ubuntu-latest
  9. outputs:
  10. should_run: ${{ steps.check.outputs.should_run }}
  11. steps:
  12. - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  13. with:
  14. fetch-depth: 1
  15. - id: check
  16. env:
  17. GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
  18. run: |
  19. if gh run list --workflow nightly.yml -c $(git rev-parse HEAD) -s success | grep 'completed'; then
  20. echo "should_run=false" >> $GITHUB_OUTPUT
  21. else
  22. echo "should_run=true" >> $GITHUB_OUTPUT
  23. fi
  24. nightly:
  25. needs: check
  26. if: needs.check.outputs.should_run == 'true'
  27. uses: charmbracelet/meta/.github/workflows/nightly.yml@main
  28. secrets:
  29. goreleaser_key: ${{ secrets.GORELEASER_KEY }}