Skip to content

Commit 21073cd

Browse files
committed
fix: error 문자열이 포함되었을 경우 빌드가 성공해도 CI가 실패했다고 뜨는 이슈 해결
1 parent 27fb444 commit 21073cd

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,6 @@ jobs:
206206
XC_STATUS=${PIPESTATUS[0]}
207207
set -e
208208
209-
if [ -f build.log ]; then
210-
echo "== error: lines =="
211-
if grep -i "error:" build.log; then
212-
if [ "$XC_STATUS" -eq 0 ]; then
213-
XC_STATUS=1
214-
fi
215-
fi
216-
fi
217-
218209
exit $XC_STATUS
219210
220211
- name: Comment build failure on PR
@@ -228,9 +219,9 @@ jobs:
228219
if (fs.existsSync(path)) {
229220
const log = fs.readFileSync(path, 'utf8');
230221
const lines = log.split(/\r?\n/);
231-
const errorLines = lines.filter((line) => /error:/i.test(line));
222+
const errorLines = lines.filter((line) => /^(.*?):(\d+):(\d+):\s+error:/i.test(line));
232223
if (errorLines.length > 0) {
233-
body += "Lines containing 'error:':\n\n```\n" + errorLines.join('\n') + '\n```\n';
224+
body += "Compiler error lines:\n\n```\n" + errorLines.join('\n') + '\n```\n';
234225
235226
const repoRoot = process.env.GITHUB_WORKSPACE || process.cwd();
236227
const pathMod = require('path');
@@ -258,7 +249,7 @@ jobs:
258249
body += "\nCode excerpts:\n\n```\n" + snippets.join('\n\n') + "\n```\n";
259250
}
260251
} else {
261-
body += "No lines containing 'error:' were found in build.log.";
252+
body += "No compiler-style error diagnostics were found in build.log.";
262253
}
263254
} else {
264255
body += 'build.log not found.';

0 commit comments

Comments
 (0)