首页 > 解决方案 > github 操作上的 Glob 降价文件仅返回 `docs` 文件夹

问题描述

我的项目中有多个包含降价文件的文件夹。我想cspell针对他们运行(和其他工具)。不幸的是,docsblob 中只返回了子文件夹中的降价文件。

这是一个动作文件的片段:

      - name: 'Spellchecking Content'
        run: |
          npm install cspell -g
          pwd
          ls ./**/*.md
          npx cspell $(ls ./**/*.md) -c ${{ github.workspace }}/cspell.json
        working-directory: ${{ github.workspace }}

同样,问题在于ls ./**/*.mdGitHub 中的操作仅返回文件docs中的 markdown 文件,而没有返回其他子文件夹中的 markdown 文件。

故障排除:

标签: githubgithub-actions

解决方案


所以,有趣的是,如果我更换

npx cspell $(ls ./**/*.md) -c ${{ github.workspace }}/cspell.json

npx cspell $(find . -name '*.md') -c ${{ github.workspace }}/cspell.json

有用。

这是 GitHub 操作中的错误还是记录在案的限制?


推荐阅读