# Repair the Dependabot lockfile The [repair workflow](workflows/dependabot-dedupe.yml) runs `pnpm dedupe` when Dependabot opens, reopens, or updates a dependency PR that changes `pnpm-lock.yaml`. If dedupe changes the lockfile, the workflow commits only that file to the PR branch. The existing `pnpm Dedupe Check` remains enabled. ## Approve checks after a repair The workflow commits with the built-in `GITHUB_TOKEN`. It doesn't need a GitHub App, repository variables, or additional secrets. After the workflow reaches the default branch, reopen an existing Dependabot dependency PR or ask Dependabot to rebase it to trigger repair. If the lockfile already passes dedupe, the workflow skips the commit job. When the workflow adds a repair commit, the resulting PR checks wait for approval. Open the PR and select **Approve workflows to run** to start those checks. The approving account needs write access to the repository. See GitHub's [workflow triggering documentation](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#triggering-a-workflow-from-a-workflow). ## Credential and commit handling The workflow runs from the PR's base branch with `pull_request_target` and accepts only Dependabot PRs from this repository's `dependabot/npm_and_yarn/` branches. Dedupe runs in a separate job with read-only repository access, without persisted checkout credentials, lifecycle scripts, pnpm hooks, or shared caches. A second dedupe check must pass before the lockfile is uploaded. The commit job reads the uploaded lockfile as data and never checks out or runs PR code. It checks that the PR is still open at the original commit, then uses an atomic head check to refuse a concurrent branch update. Repair commit messages include `[dependabot skip]` so Dependabot can continue rebasing the PR. See GitHub's [Dependabot PR documentation](https://docs.github.com/en/code-security/how-tos/secure-your-supply-chain/manage-your-dependency-security/manage-dependabot-prs).