Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/pkg-pr-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,36 @@ jobs:
if (!url) {
throw new Error("No package URL found in output.json");
}
const sourceRepo = context.payload.pull_request?.head?.repo?.full_name;
const sourceBranch = context.payload.pull_request?.head?.ref;
const hasSkillSource = Boolean(sourceRepo && sourceBranch);

const skillSection = hasSkillSource
? [
"",
"### 🧩 Skill update",
"",
"```bash",
`npx skills add ${sourceRepo}#${sourceBranch} -y -g`,
"```",
]
: [
"",
"### 🧩 Skill update",
"",
"_Unavailable for this PR because source repo/branch metadata is missing._",
];

const body = [
"Install this PR change globally:",
"<!-- pkg-pr-new-install-guide -->",
"## 🚀 PR Preview Install Guide",
"",
"### 🧰 CLI update",
"",
"```bash",
`npm i -g ${url}`,
"```",
...skillSection,
].join("\n");
const issueNumber = context.issue.number;

Expand All @@ -61,7 +84,7 @@ jobs:
const existing = comments.find((comment) =>
comment.user?.login === "github-actions[bot]" &&
typeof comment.body === "string" &&
comment.body.startsWith("Install this PR change globally:")
comment.body.includes("<!-- pkg-pr-new-install-guide -->")
);

if (existing) {
Expand Down
Loading