Skip to content

Fix GitLab runner snippets to run as current user on Windows and Mac #712

@jangel97

Description

@jangel97

Problem

As per #711, more specifically GitLab runner snippets for Windows and Mac install as system services running under privileged accounts (SYSTEM/root), unlike other integrations (GitHub Actions, Cirrus) which run as the current user.

See related comment in PR: #711 (comment)

Impact

  • Permissions issues accessing user files/directories
  • Different behavior than other CI runner integrations
  • Security concerns running as elevated accounts

Solution

Update snippets to match pattern from GitHub/Cirrus integrations:

Mac (snippet-darwin.sh)

  • Configure LaunchDaemon UserName to run as current user
  • Similar to: pkg/integrations/github/snippet-darwin.sh line 10 or pkg/integrations/cirrus/snippet-darwin.sh lines 32-35

Windows (snippet-windows.ps1)

  • Either use startup folder approach (like Cirrus)
  • Or configure service to run as current user

Files

  • pkg/integrations/gitlab/snippet-darwin.sh
  • pkg/integrations/gitlab/snippet-windows.ps1

Reference

  • GitHub snippet: pkg/integrations/github/snippet-darwin.sh
  • Cirrus snippet: pkg/integrations/cirrus/snippet-darwin.sh

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