From ba8493efd989bd367036ab005fd14b7371f91c64 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Thu, 20 Nov 2025 13:48:16 +0100 Subject: [PATCH 1/2] Create script and workflow --- .github/workflows/bump-lychee-version.yml | 20 ++++++++++++++++++++ bump-lychee.sh | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/bump-lychee-version.yml create mode 100755 bump-lychee.sh diff --git a/.github/workflows/bump-lychee-version.yml b/.github/workflows/bump-lychee-version.yml new file mode 100644 index 0000000..07068df --- /dev/null +++ b/.github/workflows/bump-lychee-version.yml @@ -0,0 +1,20 @@ +name: Links + +on: push + +# 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 }} diff --git a/bump-lychee.sh b/bump-lychee.sh new file mode 100755 index 0000000..b4a3178 --- /dev/null +++ b/bump-lychee.sh @@ -0,0 +1,23 @@ +#! /usr/bin/env bash + +POSITION=1 # 0 is nightly, 1 is latest stable release +LATEST=$(curl "https://api.github.com/repos/lycheeverse/lychee/releases" | jq -r ".[$POSITION] | .name") +FILE=src/generate/lychee-version.ts + +sed -i -e "s/LYCHEE_VERSION = \"[^\"]*\"/LYCHEE_VERSION = \"$LATEST\"/" $FILE + +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 config user.name "lychee bot" + git config user.email "noreply@lychee.cli.rs" + 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 From cab777a8fa742b0e1ba9274f1d63fb6ff08d4dde Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Thu, 20 Nov 2025 14:14:50 +0100 Subject: [PATCH 2/2] Update workflow name and trigger --- .github/workflows/bump-lychee-version.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bump-lychee-version.yml b/.github/workflows/bump-lychee-version.yml index 07068df..5ea9275 100644 --- a/.github/workflows/bump-lychee-version.yml +++ b/.github/workflows/bump-lychee-version.yml @@ -1,12 +1,10 @@ -name: Links +name: Bump lychee version -on: push - -# on: -# repository_dispatch: -# workflow_dispatch: -# schedule: -# - cron: "00 18 * * *" +on: + repository_dispatch: + workflow_dispatch: + schedule: + - cron: "00 18 * * *" jobs: bumpLycheeVersion: