History

Throttle nightly release workflow to every 3 hours (#2134)

Julius Marminge committed 7 months ago

Commit 52a60671 parent 721b6b41 file · +38 −1Browse files

Unified · Split

.github/workflows/release.yml+38−1
@@ -5,7 +5,7 @@ on: · 4 unmodified lines
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: · 14 unmodified lines
2626 id-token: write
2727
2828 jobs:
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:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t