Skip to content

Skip ripgrep apt install when rg is already available on custom runners #51723

Description

@strawgate

Problem

The generated Copilot agent job unconditionally runs:

- name: Install ripgrep
  run: sudo apt-get update -qq && sudo apt-get install -y -qq ripgrep

Many custom/full runner images already include rg. Those jobs still update apt metadata, hit package infrastructure, and perform a privileged package-manager operation on every run.

This is emitted by gh-aw v0.85.4 before checkout for workflows using the Copilot engine; it is generated output, so consumers cannot cleanly optimize the step without patching lock files.

Suggested behavior

Probe first and install only when needed, for example:

if command -v rg >/dev/null 2>&1; then
  rg --version
else
  sudo apt-get update -qq
  sudo apt-get install -y -qq ripgrep
fi

This preserves compatibility with minimal runner images while avoiding redundant network and package-manager work on pre-baked images.

Activity

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions