Skip to content

Commit fe0ab9c

Browse files
authored
ci: added additional command to fetch submodule history (#118)
1 parent 50b5764 commit fe0ab9c

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,22 @@ jobs:
7171
const package = JSON.parse(await fs.readFile('package.json', 'utf8'));
7272
const old = package.swiftorg.commit;
7373
try {
74-
const { stdout } = await exec.getExecOutput('git', ['diff', '--name-status', '--ignore-submodules=all', '--diff-filter=ACDMRTUX', `${old}..HEAD`], { cwd: 'swiftorg' });
75-
const files = stdout.split('\n').filter(Boolean).flatMap((line) => {
76-
const parts = line.split('\t');
77-
return parts.length > 2 ? [parts[1], parts[2]] : [parts[1]];
78-
}).filter((file) => /(download\/(index.md|_older-releases.md)|_data\/builds\/.*)/.exec(file));
79-
return {
80-
any_changed: files.length > 0,
81-
swift_release: files.some(file => /_data\/builds\/(swift-.*-release.*|swift_releases\.yml)/.exec(file))
82-
};
74+
await exec.exec('git', ['submodule', 'update', '--init']);
75+
const { stdout } = await exec.getExecOutput('git', ['diff', '--name-status', '--ignore-submodules=all', '--diff-filter=ACDMRTUX', `${old}..HEAD`], { cwd: 'swiftorg' });
76+
const files = stdout.split('\n').filter(Boolean).flatMap((line) => {
77+
const parts = line.split('\t');
78+
return parts.length > 2 ? [parts[1], parts[2]] : [parts[1]];
79+
}).filter((file) => /(download\/(index.md|_older-releases.md)|_data\/builds\/.*)/.exec(file));
80+
return {
81+
any_changed: files.length > 0,
82+
swift_release: files.some(file => /_data\/builds\/(swift-.*-release.*|swift_releases\.yml)/.exec(file))
83+
};
8384
} catch (error) {
84-
console.error(error);
85-
return {
86-
any_changed: true,
87-
swift_release: false
88-
};
85+
core.error(error);
86+
return {
87+
any_changed: true,
88+
swift_release: false
89+
};
8990
}
9091
9192
- name: Setup Node.js

0 commit comments

Comments
 (0)