Agent Skills
› open-mercato/open-mercato
› om-auto-publish-pr
om-auto-publish-pr
GitHub通过GitHub CLI触发Package Previews工作流,为指定PR发布pkg.pr.new预览包。用于维护者请求发布或重新发布预览时,自动执行流程并反馈运行状态。
Trigger Scenarios
维护者要求发布PR预览
需要重新触发PR预览
Install
npx skills add open-mercato/open-mercato --skill om-auto-publish-pr -g -y
SKILL.md
Frontmatter
{
"name": "om-auto-publish-pr",
"description": "Publish pkg.pr.new package previews for a same-repository Open Mercato PR by dispatching the Package Previews GitHub Actions workflow with gh. Use when a maintainer asks to publish, republish, or trigger a PR package preview. Does not publish npm snapshots."
}
Auto Publish PR Preview
Dispatch the Package Previews workflow for a PR. This publishes pkg.pr.new previews only; do not invoke NPM Snapshot Preview from this skill.
Arguments
{pr_number}(required) - Pull request number to publish previews for.--repo <owner/name>(optional) - Defaults to the current repository.--ref <branch>(optional) - Workflow definition ref. Default:develop.
Procedure
- Resolve inputs and confirm the PR exists:
REPO="${REPO:-$(gh repo view --json nameWithOwner --jq .nameWithOwner)}"
PR_NUMBER="{pr_number}"
WORKFLOW_REF="${WORKFLOW_REF:-develop}"
gh pr view "$PR_NUMBER" --repo "$REPO" \
--json number,title,headRepositoryOwner,headRefName,headRefOid,isCrossRepository
-
If
isCrossRepositoryistrue, stop. The workflow rejects fork PRs because it runs publish-capable automation from a trusted workflow context. -
Dispatch the preview workflow:
gh workflow run package-previews.yml \
--repo "$REPO" \
--ref "$WORKFLOW_REF" \
-f "pr_number=$PR_NUMBER"
- Find the newest run for the workflow and report it:
sleep 3
gh run list \
--repo "$REPO" \
--workflow package-previews.yml \
--limit 5
- Final response must include:
- PR number and title.
- The workflow ref used.
- The dispatch command result.
- The newest relevant run URL when available.
Guardrails
- Do not commit, push, label, or merge anything.
- Do not dispatch
npm-snapshot-preview.yml; that is intentionally a separate manual path. - If the workflow is not found on
develop, tell the user to pass--ref <branch-with-workflow>or wait until the workflow change is merged.
Version History
- c915d76 Current 2026-07-24 20:42


