Skip to content

Record checkout SHA runs git before the container workspace is a safe.directory (dubious ownership) #2055

Open

Description

@gerchowl

Problem

#2031 (05217f5c, "pin API file commits to checkout revisions") added a Record checkout SHA step: CHECKOUT_SHA=$(git rev-parse HEAD), placed right after actions/checkout and before Set up devkit toolchain. In a container: job the workspace (/__w/...) is owned by a different uid than the container user, and nothing has marked it as a git safe.directory yet. So git refuses:

fatal: detected dubious ownership in repository at '/__w/devkit-smoke-test/devkit-smoke-test'
##[error]Process completed with exit code 128.

This failed the 1.19.0-rc4 smoke test: Prepare Release, run 42151390302, in both Prepare Release Branch and the rollback job. 1.18.2 passed.

Scope

The step appears in 7 consumer workflows under assets/workspace/.github/workflows/: prepare-release (×2), prepare-hotfix, release-core, abandon-release, sync-issues and sync-main-to-dev. It also appears in 11 places in devkit's own .github/workflows/. In container-mode consumers, the daily sync-issues and sync-main-to-dev would fail too.

Fix

Take the SHA from actions/checkout's own commit output (steps.<id>.outputs.commit), which needs no git call. Add a static guard so no step runs git in a container job before the safe-directory setup.

Blocks 1.19.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workflowbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions