Skip to content

Commit 3040818

Browse files
committed
feat(ci): add check for changes before commit and push
1 parent 4f18a9d commit 3040818

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/cli/src/actions/ci/github.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ export async function commitAndPush(
3232
): Promise<string> {
3333
await configGit()
3434

35+
// Check if there are changes to commit before proceeding
36+
const status = await $`git status --porcelain ${path}`
37+
if (!status.stdout.trim()) {
38+
// No changes, skip commit and push, return current HEAD
39+
const hash = await $`git rev-parse HEAD`
40+
return hash.stdout.trim()
41+
}
42+
3543
await $`git pull`
3644
await $`git add ${path}`
3745
await $`git commit -m ${message}`

0 commit comments

Comments
 (0)