0

在 GitHub Actions 工作流程中,我们多次尝试使用此命令获取由推送提交更改的文件的文件名run: git diff-tree --no-commit-id --name-only -r ${{ github.sha }}。但它总是只返回以下日志,不提供文件名或带路径的文件名。见下图。

GitHub Actions 运行日志

关于 Runner type : ubuntu-latest,它不是自托管的 runner。

4

1 回答 1

2

checkout 操作默认创建一个浅克隆。利用

  - uses: actions/checkout@v2
    with:
      # Number of commits to fetch. 0 indicates all history for all branches and tags.
      # Default: 1
      fetch-depth: 2

来源:https ://github.com/actions/checkout#usage

于 2020-08-12T18:30:42.070 回答