Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions .github/workflows/bump-lychee-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Bump lychee version

on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "00 18 * * *"

jobs:
bumpLycheeVersion:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Bump lychee version
run: ./bump-lychee.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions bump-lychee.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /usr/bin/env bash

set -eo pipefail

LATEST=$(curl --fail "https://api.github.com/repos/lycheeverse/lychee/releases/latest" | jq -er ".name")
FILE=src/generate/lychee-version.ts

sed -i -e "s/LYCHEE_VERSION = \"[^\"]*\"/LYCHEE_VERSION = \"$LATEST\"/" $FILE

if [ -n "$CI" ]; then
git config user.name "lychee bot"
git config user.email "[email protected]"
fi

if git status --porcelain | grep $FILE; then
echo New version found: $LATEST
git add $FILE
BRANCH="bump-$LATEST"
MESSAGE="Bump lychee: $LATEST"
git checkout -b $BRANCH
git add $FILE
git commit --message "$MESSAGE"
git push -u origin $BRANCH
gh pr create -B master -H $BRANCH --title "$MESSAGE" --body 'Created by Github action'
else
echo Version is up to date
fi
Loading