Interview Prep/CI/CD/GitHub Actions

How does `actions/checkout` behave regarding history and submodules?

IntermediateConceptGitHub Actions
Answer

By default it does a shallow clone (fetch-depth: 1) of the triggering commit, which is fast but breaks things that need history: git describe, changelog generation, SonarQube blame, or merge-base diffs. Set fetch-depth: 0 for full history, submodules: recursive for submodules, and persist-credentials: false to avoid leaving the token in .git/config when later steps run untrusted code.

- uses: actions/checkout@v4
  with:
    fetch-depth: 0
    persist-credentials: false
All CI/CD questions

More on GitHub Actions