Skip to content

Commit 8e3fefb

Browse files
committed
ci: run changelog dry run on macos
1 parent e28a696 commit 8e3fefb

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

.github/workflows/changelog-dry-run.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818

1919
jobs:
2020
changelog-api-dry-run:
21-
runs-on: ubuntu-latest
21+
runs-on: macos-latest
2222
permissions:
2323
contents: read
2424

@@ -149,8 +149,33 @@ jobs:
149149
});
150150
});
151151
152+
function formatRequestError(err) {
153+
if (!err) {
154+
return '(empty error)';
155+
}
156+
const lines = [`${err.name || 'Error'}: ${err.message || String(err)}`];
157+
if (err.code) {
158+
lines.push(`code: ${err.code}`);
159+
}
160+
if (err.address || err.port) {
161+
lines.push(`target: ${err.address || '(unknown address)'}:${err.port || '(unknown port)'}`);
162+
}
163+
if (Array.isArray(err.errors)) {
164+
for (const inner of err.errors) {
165+
lines.push(`cause: ${inner.name || 'Error'}: ${inner.message || String(inner)}`);
166+
if (inner.code) {
167+
lines.push(`cause code: ${inner.code}`);
168+
}
169+
if (inner.address || inner.port) {
170+
lines.push(`cause target: ${inner.address || '(unknown address)'}:${inner.port || '(unknown port)'}`);
171+
}
172+
}
173+
}
174+
return lines.join('\n');
175+
}
176+
152177
req.on('error', err => {
153-
console.error(`Changelog API request failed: ${err.message || err}`);
178+
console.error(`Changelog API request failed:\n${formatRequestError(err)}`);
154179
process.exit(1);
155180
});
156181

0 commit comments

Comments
 (0)