File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 tags :
66 - " v*.*.*"
77 schedule :
8- - cron : " 0 9 * * *"
8+ - cron : " 0 */3 * * *"
99 workflow_dispatch :
1010 inputs :
1111 channel :
@@ -26,8 +26,45 @@ permissions:
2626 id-token : write
2727
2828jobs :
29+ check_changes :
30+ name : Check for changes since last nightly
31+ if : github.event_name == 'schedule'
32+ runs-on : ubuntu-24.04
33+ outputs :
34+ has_changes : ${{ steps.check.outputs.has_changes }}
35+ steps :
36+ - name : Checkout
37+ uses : actions/checkout@v6
38+ with :
39+ fetch-depth : 0
40+
41+ - id : check
42+ name : Compare HEAD to last nightly tag
43+ run : |
44+ last_nightly_tag=$(git tag --list 'nightly-v*' --sort=-creatordate | head -n 1)
45+ if [[ -z "$last_nightly_tag" ]]; then
46+ echo "No previous nightly tag found. Proceeding with release."
47+ echo "has_changes=true" >> "$GITHUB_OUTPUT"
48+ exit 0
49+ fi
50+
51+ last_nightly_sha=$(git rev-parse "$last_nightly_tag^{commit}")
52+ head_sha=$(git rev-parse HEAD)
53+
54+ if [[ "$last_nightly_sha" == "$head_sha" ]]; then
55+ echo "No changes on main since last nightly release ($last_nightly_tag). Skipping."
56+ echo "has_changes=false" >> "$GITHUB_OUTPUT"
57+ else
58+ echo "Changes detected on main since $last_nightly_tag ($last_nightly_sha → $head_sha). Proceeding."
59+ echo "has_changes=true" >> "$GITHUB_OUTPUT"
60+ fi
61+
2962 preflight :
3063 name : Preflight
64+ needs : [check_changes]
65+ if : |
66+ !failure() && !cancelled() &&
67+ (github.event_name != 'schedule' || needs.check_changes.outputs.has_changes == 'true')
3168 runs-on : blacksmith-8vcpu-ubuntu-2404
3269 timeout-minutes : 10
3370 outputs :
You can’t perform that action at this time.
0 commit comments