Skip to content

CICD-015 · Check out the triggering commit ​

Encyclopedia · Jobs, steps and runner selection · All snippets

Previous · CICD-014 · Next · CICD-016

1. Where it fits ​

  • Placement .github/workflows/ci.yml, under a job's steps.
  • Prerequisites workflow containing the named example jobs or steps.
  • Platforms github-actions, gitea-actions.

2. Copy the snippet ​

yaml
uses: actions/checkout@v4
with:
  persist-credentials: false

3. How it works ​

checkout materializes the selected source ref inside this job. persist-credentials false stops the action from retaining the checkout credential for subsequent Git commands.

4. Verify the result ​

Check for .git and verify git rev-parse HEAD. PR runs may check out a merge ref.

Validation syntax-validated (YAML parse). Status definitions.