GitHub Actions: Getting All the Commits
Today I learned something new. I tried using GitHub Actions to check the dates of commits in a repository. To my surprise, it didn’t work correctly, but it worked fine on my computer.
After looking around, I found out that GitHub Actions only fetches the latest commits from your repository, which is called a shallow clone.
To access the entire history of commits, tags, and branches, you need to specify it in the actions/checkout
action like this:
- uses: actions/checkout@v4
with:
fetch-depth: 0