actions/checkout
actions/checkout saves the workflow token (GITHUB_TOKEN or a custom one) in the checked-out repo’s .git/config by default. Workflows that upload the repo as an artifact leak it, and Unit 42 found many projects doing this. GitHub calls it intended behaviour. Turn it off, and scan workflows with zizmor, which would have caught the Ultralytics injection.
- uses: actions/checkout@v4
with:
persist-credentials: false