如何打印' ls'的输出命令github动作控制台?

发布于 2025-02-13 07:06:54 字数 587 浏览 0 评论 0原文

我遇到了一个问题,令人惊讶的是,我无法通过github动作从我的存储库中运行脚本。我添加了ls语句,以查看是否需要更改为其他目录。但是,LS的输出未在GitHub Action Console中打印。

name: Continuous integration pipeline

on: push

jobs:
  setup:
    name: Run Tests
    runs-on: ubuntu-20.04

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v3
      - name: Use Node.js 14
        uses: actions/setup-node@v1
        with:
          node-version: "14.x"
      - name: Main
        run: |
          - ls
          - node scripts/setup-npm-version.js

如何修改ls语句,以便输出将在控制台中打印?

I'm having a problem where surprisingly I am unable to run scripts from my repo in a Github action. I have added an ls statement to see if I need to change into some other directory. However, the output from ls is not printed in the Github actions console.

name: Continuous integration pipeline

on: push

jobs:
  setup:
    name: Run Tests
    runs-on: ubuntu-20.04

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v3
      - name: Use Node.js 14
        uses: actions/setup-node@v1
        with:
          node-version: "14.x"
      - name: Main
        run: |
          - ls
          - node scripts/setup-npm-version.js

How can I modify the ls statement so that the output will be printed in the console?

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

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

发布评论

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

评论(1

盗琴音 2025-02-20 07:06:54

删除破折号:

      - name: Main
        run: |
          ls
          node scripts/setup-npm-version.js

我实际上建议将两个命令分为两个步骤:

      - run: ls
      - name: Main
        run: node scripts/setup-npm-version.js

Remove the dashes:

      - name: Main
        run: |
          ls
          node scripts/setup-npm-version.js

I would actually recommend splitting the two commands into two run steps:

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