Skip to content

Commit 7a6bfc6

Browse files
committed
Delay return code propagation from exec()
1 parent bae7fee commit 7a6bfc6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ export async function run(): Promise<void> {
5757
if (core.getInput('strict') === 'true') {
5858
swiftlintArgs.push('--strict')
5959
}
60-
await exec.exec(
60+
const returnCode = await exec.exec(
6161
path.join(portableSwiftlintDir, 'swiftlint'),
6262
swiftlintArgs,
6363
{
64+
ignoreReturnCode: true,
6465
listeners: {
6566
stdout: (data: Buffer) => {
6667
stdout += data.toString()
@@ -96,6 +97,8 @@ export async function run(): Promise<void> {
9697
startColumn: entry.character
9798
})
9899
}
100+
101+
process.exit(returnCode)
99102
} catch (error) {
100103
// Fail the workflow run if an error occurs
101104
if (error instanceof Error) core.setFailed(error.message)

0 commit comments

Comments
 (0)