繁体   English   中英

如何在 GitHub Actions 中获取提交更新的文件的文件名?

[英]How to get file names of files updated by commit in GitHub Actions?

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

GitHub Actions 运行日志

关于 Runner 类型ubuntu-latest ,它不是自托管的运行器。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM