Github actions `git log ` only output one line

github actions git log only output one line

jobs:

  install_dependence_job:

    runs-on: ubuntu-18.04

    steps: 
    - uses: actions/checkout@v2
      with:
        ref: master

    - name: print machine info
      run: |
        pwd
        ls -a -l
        git --version
        echo "---------------------------"
        git --no-pager log --pretty=format:%H···@/@···%cd···@/@···%s···@/@···  --date='format:%Y-%m-%d %H:%M:%S %z' --since='2020-05-22 22:07:39 +0800'
        echo "---------------------------"
        git --no-pager log --pretty=format:%H···@/@···%cd···@/@···%s···@/@···  --date='format:%Y-%m-%d %H:%M:%S %z'

I try set ‘runs-on’ is macos , the result are same. Only one Line

git version 2.26.2
---------------------------
c0cb4bfbe258c947fce1ef6ad0c277f0e2586edc···@/@···2020-05-26 22:10:47 +0800···@/@···试试 Ubuntu 的表现···@/@···
---------------------------
c0cb4bfbe258c947fce1ef6ad0c277f0e2586edc···@/@···2020-05-26 22:10:47 +0800···@/@···试试 Ubuntu 的表现···@/@···

but on my PC I got many outoup:


eb3d0ce2770b00522ffc91f8b8163501d50f19b5···@/@···2020-05-26 21:58:05 +0800···@/@···不分页···@/@···
30471395c68247e882a18a357a8e4b33bf2f0b91···@/@···2020-05-26 21:55:47 +0800···@/@···不限时间···@/@···
c628d9e940bae0ccad5b5699376140ee3820561b···@/@···2020-05-26 21:45:52 +0800···@/@···在 yml 脚本校验修改行数···@/@···
9483e767f8ded6a13a49d0e63ae3dfae04b4021b···@/@···2020-05-26 21:41:08 +0800···@/@···校验获取到的修改数目···@/@···
0a48de3797013e907eb46e06d1c7a5c563c77af6···@/@···2020-05-26 21:24:39 +0800···@/@···文件修改C···@/@···
b4f41ded54ee97d874e366e0eb6f6af8b177ae68···@/@···2020-05-26 21:19:34 +0800···@/@···ε=(´ο`*)))唉···@/@···
36f733a672a563ef7eac7b26501fcf9474943478···@/@···2020-05-26 21:08:35 +0800···@/@···路径修正 2···@/@···
d90f0ac181f268901c8ed1f42c28c0e82eb83fe8···@/@···2020-05-26 21:05:56 +0800···@/@···路径修正···@/@···
6c7695bfe467c91e39a3a81abe924f531a614f51···@/@···2020-05-26 21:03:48 +0800···@/@···路径文件啊校验···@/@···
66169d95ca9553d7065f2b5f9a2ed79d146d704c···@/@···2020-05-26 21:00:54 +0800···@/@···路径切换问题建安···@/@···
1cc1d3611573766807bb0f47ab1c86a6baac00f0···@/@···2020-05-26 20:52:37 +0800···@/@···测试 git 命令是否可运行···@/@···
7ae0bd0945838cadcb9a1eee87ce8cbef9cb9103···@/@···2020-05-26 20:47:00 +0800···@/@···全量测试···@/@···
38a85a45b11c4d251f41ca3c43bd9c286f085bd4···@/@···2020-05-26 09:54:15 +0800···@/@···显示隐藏文件···@/@···
......

So why , how to get all output of git commond?

Hi @tomgarden,

This is due to ‘actions/checkout’ will fetch history with depth 1 by default.
You can add ‘fetch-depth: 0’ to actions/checkout to get all history. Code sample as below:

    - uses: actions/checkout@v2
      with:
        ref: master
        fetch-depth: 0

Thanks

1 Like