Skip to content

Commit 92dda08

Browse files
authored
chore: add vercel-ignore-command.sh script and update vercel.json configuration (#205)
This pull request includes changes to add a new script for Vercel build ignoring, update the Vercel configuration, and modify the sync client configuration. The most important changes are: ### New Script Addition: * Added a new script `vercel-ignore-command.sh` to ignore builds for pull requests created by `dependabot[bot]` if the branch is not `main`. ### Vercel Configuration Updates: * Updated `vercel.json` to include the new `ignoreCommand`, set the build and install commands, specify the framework as `vitepress`, and define the output directory. ### Sync Client Configuration Update: * Updated `.github/sync-client.yml` to include the new script in the sync process.
1 parent 9013094 commit 92dda08

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.github/sync-client.yml

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ lumirlumir/lumirlumir-configs:
4242
dest: ./configs/.vscode/npm-extensions.json
4343
- source: ./.vscode/settings.json
4444
dest: ./configs/.vscode/settings.json
45+
# ./scripts
46+
- source: ./scripts/vercel-ignore-command.sh
47+
dest: ./configs/scripts/vercel-ignore-command.sh
4548
# ./
4649
- source: ./.editorconfig
4750
dest: ./configs/.editorconfig

scripts/vercel-ignore-command.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
# If the PR is created by `dependabot[bot]` and the branch is not `main`, ignore the build.
4+
if [ "$VERCEL_GIT_COMMIT_AUTHOR_LOGIN" = "dependabot[bot]" ] && [ "$VERCEL_GIT_COMMIT_REF" != "main" ]; then
5+
echo "🛑 Ignoring build for dependabot[bot] PR (branch: $VERCEL_GIT_COMMIT_REF, author: $VERCEL_GIT_COMMIT_AUTHOR_LOGIN)"
6+
exit 0 # Return `0` to skip the build.
7+
fi
8+
9+
# Proceed with the build in other cases.
10+
echo "✅ Proceeding with the build (branch: $VERCEL_GIT_COMMIT_REF, author: $VERCEL_GIT_COMMIT_AUTHOR_LOGIN)"
11+
exit 1 # Return `1` to proceed with build.

website/vercel.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"cleanUrls": true
2+
"buildCommand": "npm run build",
3+
"cleanUrls": true,
4+
"framework": "vitepress",
5+
"ignoreCommand": "bash ../scripts/vercel-ignore-command.sh",
6+
"installCommand": "npm install --prefix ..",
7+
"outputDirectory": "build"
38
}

0 commit comments

Comments
 (0)