@serverless-cd/checkout
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

下载仓库代码(@serverless-cd/checkout)

快速体验

- plugin: "@serverless-cd/checkout"
  inputs:
   # 通过分支或者tag来下载仓库,比如:refs/heads/main 或者 refs/tags/v0.0.1
    ref: ""

    # 通过commit id来下载仓库
    commit: ""

    # 用于下载仓库的个人访问令牌 比如:github的个人访问令牌(https://github.com/settings/tokens)。
    token: ""

    # 支持下载的代码托管平台(github、gitee、gitlab、codeup)
    provider: ""

    # 仓库的克隆地址,比如:https://gitee.com/shihuali/checkout.git
    clone_url: ""

    # 仓库owner,比如clone_url为https://gitee.com/shihuali/checkout.git时,owner应为 shihuali
    owner: ""

    # 代码下载目录
    exec_dir: ""

字段解析

参数 说明 类型 必填 默认值
ref 通过分支或者 tag 来下载仓库,比如:refs/heads/main 或者 refs/tags/v0.0.1 string
commit 通过 commit id 来下载仓库 string
exec_dir 代码下载目录 string 临时目录
token 用于下载仓库的个人访问令牌 比如:github 的个人访问令牌 string
provider 支持下载的代码托管平台 enum:github、gitee、gitlab、codeup
clone_url 仓库的克隆地址 string
owner 仓库 owner string

注意 Engine 调用方式

对于 checkout 插件而言,调用 engine 的时候需要注入 checkout 插件所需要的参数

const engine = new Engine({
  cwd: __dirname,
  steps,
  logConfig: { logPrefix },
  inputs: {
    git: {
      token: "xxx",  // 必填
      provider: "gitee", // 必填
      owner: "shihuali", // 必填
      clone_url: "https://gitee.com/shihuali/checkout.git", // 必填
      exec_dir: "./checkout", // 选填
      ref: "refs/heads/main", // 选填
      commit: 'xx' // 选填
    },
  },
});
await engine.start();

作为普通的 NPM Module 使用

Readme

Keywords

none

Package Sidebar

Install

npm i @serverless-cd/checkout

Weekly Downloads

1

Version

0.1.1

License

ISC

Unpacked Size

38.6 kB

Total Files

21

Last publish

Collaborators

  • loganhz
  • windwaving
  • andymanastorm
  • lowkeyrd
  • ls_nodejs
  • huipeng
  • hazel0928
  • kwtboom
  • fengc123
  • wssgryx
  • xsahxl
  • heimanba