mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Fix run URLs in CI comments
This commit is contained in:
2
.github/workflows/comment.yml
vendored
2
.github/workflows/comment.yml
vendored
@@ -37,7 +37,7 @@ jobs:
|
||||
else
|
||||
echo -e "✅ @${{ github.actor }}, all tests passed!" > comment.md
|
||||
fi
|
||||
echo -e "\n**[View logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})**" >> comment.md
|
||||
echo -e "\n**[View logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }})**" >> comment.md
|
||||
echo -e "<!-- generated-comment workflow=${{ github.workflow }} -->" >> comment.md
|
||||
- name: Find Comment
|
||||
id: comment
|
||||
|
||||
@@ -538,6 +538,13 @@ function mabeCapitalize(str) {
|
||||
}
|
||||
|
||||
console.log("-> test-report.md, test-report.json");
|
||||
function linkify(text, url) {
|
||||
if (url?.startsWith?.("https://")) {
|
||||
return `[${text}](${url})`;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
if (ci) {
|
||||
if (failing_tests.length > 0) {
|
||||
@@ -546,8 +553,11 @@ if (ci) {
|
||||
action.setOutput("failing_tests", failingTestDisplay);
|
||||
action.setOutput("failing_tests_count", failing_tests.length);
|
||||
if (failing_tests.length) {
|
||||
const { env } = process;
|
||||
const tag = process.env.BUN_TAG || "unknown";
|
||||
let comment = `## ${emojiTag(tag)}${failing_tests.length} failing tests ${tag
|
||||
const url = `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}`;
|
||||
|
||||
let comment = `## ${linkify(`${emojiTag(tag)}${failing_tests.length} failing tests`, url)} ${tag
|
||||
.split("-")
|
||||
.map(mabeCapitalize)
|
||||
.join(" ")}
|
||||
|
||||
Reference in New Issue
Block a user