diff --git a/.github/workflows/pkg-pr-new.yml b/.github/workflows/pkg-pr-new.yml index f529abc3..ee07e71f 100644 --- a/.github/workflows/pkg-pr-new.yml +++ b/.github/workflows/pkg-pr-new.yml @@ -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:", + "", + "## 🚀 PR Preview Install Guide", + "", + "### 🧰 CLI update", "", "```bash", `npm i -g ${url}`, "```", + ...skillSection, ].join("\n"); const issueNumber = context.issue.number; @@ -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("") ); if (existing) {