File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,16 @@ import {
7
7
CommitFilesResult ,
8
8
} from "./interface" ;
9
9
10
+ /**
11
+ * @see https://isomorphic-git.org/docs/en/walk#walkerentry-mode
12
+ */
13
+ const FILE_MODES = {
14
+ directory : 0o40000 ,
15
+ file : 0o100644 ,
16
+ executableFile : 0o100755 ,
17
+ symlink : 0o120000 ,
18
+ } as const ;
19
+
10
20
export const commitChangesFromRepo = async ( {
11
21
base,
12
22
repoDirectory = process . cwd ( ) ,
@@ -50,6 +60,14 @@ export const commitChangesFromRepo = async ({
50
60
) {
51
61
return null ;
52
62
}
63
+ if (
64
+ ( await commit ?. mode ( ) ) === FILE_MODES . symlink ||
65
+ ( await workdir ?. mode ( ) ) === FILE_MODES . symlink
66
+ ) {
67
+ throw new Error (
68
+ `Unexpected symlink at ${ filepath } , GitHub API only supports files and directories. You may need to add this file to .gitignore` ,
69
+ ) ;
70
+ }
53
71
const prevOid = await commit ?. oid ( ) ;
54
72
const currentOid = await workdir ?. oid ( ) ;
55
73
// Don't include files that haven't changed, and exist in both trees
You can’t perform that action at this time.
0 commit comments