Skip to content

Commit ec72254

Browse files
authored
Improve .gitignore management in build-to-branch workflow
Refactor .gitignore handling in build workflow
1 parent efea3cf commit ec72254

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/build-to-branch.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ jobs:
6464
git config user.name "github-actions"
6565
git config user.email "github-actions@github.com"
6666
67+
# 保存 .gitignore
68+
cp .gitignore /tmp/gitignore.tmp
69+
6770
# 切换或创建 build 分支
6871
git checkout -B build
6972
@@ -78,9 +81,7 @@ jobs:
7881
# cp package.json next.config.js .
7982
8083
# copy .gitignore
81-
git reset .gitignore
82-
git checkout -- .gitignore
83-
cp .gitignore .
84+
cp /tmp/gitignore.tmp .gitignore
8485
8586
git add .
8687
git commit -m "chore: build from $GITHUB_SHA"

0 commit comments

Comments
 (0)