Skip to content

Commit 2d1c280

Browse files
committed
Only set git user in CI
1 parent 27fedd8 commit 2d1c280

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

bump-lychee.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
#! /usr/bin/env bash
22

3-
set -euo pipefail
3+
set -eo pipefail
44

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

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

10+
if [ -n "$CI" ]; then
11+
git config user.name "lychee bot"
12+
git config user.email "noreply@lychee.cli.rs"
13+
fi
14+
1015
if git status --porcelain | grep $FILE; then
1116
echo New version found: $LATEST
1217
git add $FILE
1318
BRANCH="bump-$LATEST"
1419
MESSAGE="Bump lychee: $LATEST"
1520
git checkout -b $BRANCH
1621
git add $FILE
17-
git config user.name "lychee bot"
18-
git config user.email "noreply@lychee.cli.rs"
1922
git commit --message "$MESSAGE"
2023
git push -u origin $BRANCH
2124
gh pr create -B master -H $BRANCH --title "$MESSAGE" --body 'Created by Github action'

0 commit comments

Comments
 (0)