簡體   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