如何测试自定义 GitHub 操作而不将其发布到市场?

She*_*llD 3 github-actions

我创建了一个 GitHub 操作,我正在寻找一种在将其发布到市场之前对其进行测试的方法。如何通过在同一存储库中创建工作流程文件来测试它?

我有以下工作流程。

name: "Build"
on:
  pull_request:
  push:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: test-action # name of my action
Run Code Online (Sandbox Code Playgroud)

Rob*_*aju 11

您可以使用该./语法来使用同一存储库中可用的操作。

  steps:  
    - uses: ./
      with:
       # input params if you have any
Run Code Online (Sandbox Code Playgroud)


Gui*_*urd 6

You can also call the action specific branch to use an action which hasn't been published yet (even in other repositories).

  steps:  
    - uses: <username>/<repo-name>@<branch-name>
      with:
       # input params if there is any
Run Code Online (Sandbox Code Playgroud)

This can (for example) allow to test implementations located in different branches.