Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/canary-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,50 @@ on:
default: false

jobs:
check-commits:
runs-on: ubuntu-latest
outputs:
has_new_commits: ${{ steps.check.outputs.has_new_commits }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for new commits since last canary
id: check
run: |
# PR and manual triggers always proceed
if [ "${{ github.event_name }}" != "schedule" ]; then
echo "Trigger is '${{ github.event_name }}' — skipping commit check."
echo "has_new_commits=true" >> "$GITHUB_OUTPUT"
exit 0
fi

git fetch --tags origin

# Find the most recent canary tag
LAST_CANARY=$(git tag --list 'v*-canary-*' --sort=-creatordate | head -1)

if [ -z "$LAST_CANARY" ]; then
echo "No previous canary tag found — proceeding."
echo "has_new_commits=true" >> "$GITHUB_OUTPUT"
exit 0
fi

echo "Last canary tag: $LAST_CANARY"
COMMIT_COUNT=$(git rev-list "${LAST_CANARY}..HEAD" --count)
echo "New commits since $LAST_CANARY: $COMMIT_COUNT"

if [ "$COMMIT_COUNT" -eq 0 ]; then
echo "No new commits since last canary — skipping workflow."
echo "has_new_commits=false" >> "$GITHUB_OUTPUT"
else
echo "has_new_commits=true" >> "$GITHUB_OUTPUT"
fi

canary:
needs: check-commits
if: needs.check-commits.outputs.has_new_commits == 'true'
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
Expand Down
Loading