Skip to content

ci: weekly "Lock File Maintenance" failing across 3 repos (protected-branch push, missing .nvmrc, perms cap) #7

@cohenrobinson

Description

@cohenrobinson

Summary

The scheduled Lock File Maintenance workflow (driven by the shared reusable workflows in this repo) has been failing weekly in three consumer repos, each for a distinct root cause. The lockfiles silently never refresh, and the recurring red runs mask real CI failures.

The three failures

1. platform-apifailure (push to protected main rejected)

reusable-lock-file-poetry.yml refreshes poetry.lock, commits, and pushes directly to main:

remote: error: GH006: Protected branch update failed for refs/heads/main.
 ! [remote rejected] main -> main (protected branch hook declined)

Only fails on weeks where the lock actually changes (some weeks pass — e.g. 2026-05-29 was green).
Fix: have the reusable open a PR (e.g. peter-evans/create-pull-request) instead of pushing to a protected branch — fixes this class org-wide.

2. ums-portalfailure (missing .nvmrc)

reusable-lock-file-npm.yml uses setup-node with node-version-file: ".nvmrc", but ums-portal has no .nvmrc:

##[error]The specified node version file at: .../.nvmrc does not exist

Fails deterministically every run.
Fix: add a .nvmrc to ums-portal, or change the reusable to node-version-file: 'package.json' / a literal node-version.

3. platform-mcpstartup_failure (caller permissions cap)

Caller .github/workflows/lock-file-maintenance.yml declares permissions: contents: read, but the reusable needs contents: write. A caller can't grant less than the reusable requires → the run never starts. Regressed on 2026-05-05 (commit a2a4bd0 "chore(security): CodeQL 2026-05 remediation" tightened top-level perms; conclusion flipped failurestartup_failure on 2026-05-08).
Fix: set the caller's permissions: contents: write (matching platform-api's caller).

Acceptance criteria

  • platform-api: lockfile maintenance no longer pushes to protected main (PR-based or otherwise green).
  • ums-portal: .nvmrc present (or reusable no longer requires it); run green.
  • platform-mcp: caller grants contents: write; workflow starts and runs green.
  • A green Lock File Maintenance run observed in all three repos.

Context

Found while reviewing CI health (2026-06-06). Reusables: reusable-lock-file-poetry.yml, reusable-lock-file-npm.yml (this repo). The PR-based fix for (1) is highest-leverage — it removes the protected-branch failure for any repo using the poetry reusable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions