-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (48 loc) · 1.59 KB
/
check-release.yml
File metadata and controls
55 lines (48 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Check Release
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Daily at midnight UTC
jobs:
check-and-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
- name: Check for new Deno version
id: check
env:
GH_TOKEN: ${{ github.token }}
run: |
# Get latest Deno version
NEW_VERSION=$(gh release view --repo denoland/deno --json tagName --jq '.tagName' | sed 's/^v//')
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
# Set the version
uv version "$NEW_VERSION"
# Check if there are changes
if git diff --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "No changes needed"
else
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "New version available: $NEW_VERSION"
fi
- name: Create PR
if: steps.check.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${{ steps.check.outputs.version }}"
git config user.email "action@github.com"
git config user.name "GitHub Action"
BRANCH="update-deno-$VERSION"
git checkout -b "$BRANCH"
git add -A
git commit -m "Update to Deno $VERSION"
git push -u origin "$BRANCH"
gh pr create \
--title "Update to Deno $VERSION" \
--body "Automated update from Deno release v$VERSION"