Skip to content

Check Bun Release

Check Bun Release #111

name: Check Bun Release
on:
schedule:
- cron: "0 6 * * *" # daily at 06:00 UTC
workflow_dispatch:
permissions:
contents: write
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest Bun version
id: bun
run: |
LATEST=$(curl -fsSL https://api.github.com/repos/oven-sh/bun/releases/latest | jq -r '.tag_name' | sed 's/^bun-v//')
echo "version=$LATEST" >> "$GITHUB_OUTPUT"
echo "Latest Bun: $LATEST"
- name: Check if tag exists
id: check
run: |
VERSION="${{ steps.bun.outputs.version }}"
if git rev-parse "v${VERSION}" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "Tag v${VERSION} already exists"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "Tag v${VERSION} is new"
fi
- name: Create and push tag
if: steps.check.outputs.exists == 'false'
run: |
VERSION="${{ steps.bun.outputs.version }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v${VERSION}" -m "Bun ${VERSION}"
git push origin "v${VERSION}"
echo "Created tag v${VERSION} — release workflow will build and push images."