github动作错误,因为它可以查看文件夹

发布于 2025-01-26 08:57:16 字数 1195 浏览 4 评论 0原文

我正在尝试设置我的第一个gihub动作。它需要做的就是对我的Godot文件进行测试。我基于模板。

name: CI

on:
  pull_request:
    branches: [ main ]
  workflow_dispatch:
  
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: godot-tester
      uses: croconut/[email protected]
      with:
        version: 3.4
        release_type: stable
        # Give relative path to your project.godot, if not in top level of repo
        path: app

操作每次试图找到项目文件时都会出错。

/entrypoint.sh: line 166: cd: ./app: No such file or directory

文件夹在那里,它包含项目。我尝试过有或没有拖延的斜线,这没有什么区别。

I'm trying to set up my first GiHub Action. All it needs to do is run a test over my Godot files. I based it on a template.

name: CI

on:
  pull_request:
    branches: [ main ]
  workflow_dispatch:
  
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: godot-tester
      uses: croconut/[email protected]
      with:
        version: 3.4
        release_type: stable
        # Give relative path to your project.godot, if not in top level of repo
        path: app

The action errors every time, when trying to find the project file.

/entrypoint.sh: line 166: cd: ./app: No such file or directory

A screenshot of the error

The folder, app, is there and it contains the project. I've tried with or without a trailing slash, it makes no difference.

enter image description here
The app folder, showing the project file

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↘紸啶 2025-02-02 08:57:16

当您需要从github操作工作流中的适当存储库中访问文件时,需要设置 actions/checkut < /a>首先。

这将允许工作流访问 github工作区(基本上是存储库根)。

在您的情况下,工作流程应该看起来像这样:

name: CI

on:
  pull_request:
    branches: [ main ]
  workflow_dispatch:
  
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: godot-tester
      uses: croconut/[email protected]
      with:
        version: 3.4
        release_type: stable
        # Give relative path to your project.godot, if not in top level of repo
        path: app

Action/Checkout操作具有默认行为,但是您还可以配置其他字段以自定义您想要的操作。检查 Action Readme Page 查看所有可能性。

When you need to access the files from the proper repository in a Github Actions workflow, you need to setup the actions/checkout first.

This will allow the workflow to access the Github workspace (which is basically the repository root).

In your case, the workflow should look like this:

name: CI

on:
  pull_request:
    branches: [ main ]
  workflow_dispatch:
  
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: godot-tester
      uses: croconut/[email protected]
      with:
        version: 3.4
        release_type: stable
        # Give relative path to your project.godot, if not in top level of repo
        path: app

The actions/checkout action has a default behavior, but you can also configure other fields to customize what you want it to do. Check the action README page to see all the possibilities.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文