Skip to content

Commit eebc770

Browse files
committed
Throw an error when executable files are found
1 parent e151efe commit eebc770

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changeset/lazy-icons-cheer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@changesets/ghcommit": minor
3+
---
4+
5+
Throw an error when executable files are encountered

src/git.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ export const commitChangesFromRepo = async ({
6868
`Unexpected symlink at ${filepath}, GitHub API only supports files and directories. You may need to add this file to .gitignore`,
6969
);
7070
}
71+
if ((await workdir?.mode()) === FILE_MODES.executableFile) {
72+
throw new Error(
73+
`Unexpected executable file at ${filepath}, GitHub API only supports non-executable files and directories. You may need to add this file to .gitignore`,
74+
);
75+
}
7176
const prevOid = await commit?.oid();
7277
const currentOid = await workdir?.oid();
7378
// Don't include files that haven't changed, and exist in both trees

0 commit comments

Comments
 (0)