如何将默认工作流程(git 中心操作)发布到 git 中心市场?

How to publish the default workflow(github action) to git hub marketplace?

我有一个 GitHub 动作,其中包含一些 npm 和 gulp 命令,最后运行一个 Powershell 文件。我想在市场上发布此 GitHub 操作,以便我的团队可以使用它。我无法在任何地方找到解决此问题的方法。我查看了publish Github actions文档,没有相关文档。

如何从外部调用此操作?

例如,我如何转换这个简单的操作以便将其发布到市场?

示例 yml 代码

# This is a basic workflow to help you get started with Actions

name: CI

on:
  push:
    branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: windows-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '10.x'
      - name: Install dependencies
        run: |
          npm install

谢谢

您在此处发布的 yaml 是一个工作流,而不是一个动作。一个动作是像 uses: actions/checkout@v2(通常是 JavaScript 这样的东西背后的代码,也可以被 Dockerized)。如果您只编写 YAML,那么您只是在编写一个 调用 操作的工作流。

如果您想自己动手,请查看 docs