Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Jun 18, 2024
1 parent fa510a6 commit 4e688e7
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,25 @@ export class GitHub {

public static async annotateBuildWarnings(source: string, st: SolveStatus): Promise<void> {
st.warnings?.forEach(warning => {
core.info(JSON.stringify(warning, null, 2));
if (!warning.detail || !warning.short) {
return;
}

const short = atob(warning.short);
let detail = warning.detail.map(encoded => atob(encoded).replace(/\s\(line \d+\)$/, '')).join(' ');
if (warning.url) {
detail += `\nMore info: ${warning.url}`;
}

core.info(`warning.level=${warning.level}`);
core.info(`warning.url=${warning.url}`);
core.info(`warning.short=${atob(warning.short)}`);
core.info(`warning.detail=${warning.detail?.map(encoded => atob(encoded)).join(' ') || ''}`);
core.info(`short=${short}`);
core.info(`detail=${detail}`);

if (!warning.detail || !warning.short) {
return;
}

core.warning(atob(warning.short), {
title: warning.detail.map(encoded => atob(encoded).replace(/\s\(line \d+\)$/, '')).join(' '),
core.warning(short, {
title: detail,
file: source,
startLine: warning.range && warning.range.length > 0 ? warning.range[0]?.start.line : undefined
});
Expand Down

0 comments on commit 4e688e7

Please sign in to comment.