代码之家  ›  专栏  ›  技术社区  ›  pkaramol

无法调用本地自定义GitHub操作

  •  0
  • pkaramol  · 技术社区  · 8 月前

    我正在尝试调用一个自定义github操作,该操作与调用工作流位于同一存储库中。我这样调用它

        - name: test action
          uses: MyOrg/MyRepo/.github/actions/my_action@master
          with:
            image: localhost/test-image:latest
            my_secret: ${{ secrets.MY_SECRET }}
    

    不管怎样 Unable to Resolve Action

    文件在那里:

    ls .github/actions/my_action.yaml 
    

    这个用例的正确语法是什么?

    1 回复  |  直到 8 月前
        1
  •  1
  •   Rajneesh Rai    8 月前

    请先签出您的回购,然后使用相对路径访问存储库中的操作,使用。点

    - uses: actions/checkout@v2 # checkout 
    - name: test action
      uses: ./.github/actions/my_action # Use relative path,No need to specify branch name
      with:
        image: localhost/test-image:latest
        my_secret: ${{ secrets.MY_SECRET }}