Skip to content

Add run-script feature#255

Merged
sebst merged 2 commits intomainfrom
copilot/add-run-script-feature
Mar 31, 2026
Merged

Add run-script feature#255
sebst merged 2 commits intomainfrom
copilot/add-run-script-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Adds a new run-script feature that executes a custom script during devcontainer build — either downloaded from a URL or provided as inline text.

Behavior

  • url — downloads the script via wget (preferred) or curl; installs curl via apt if neither is present
  • script — writes inline text to a mktemp temp file via printf | tee, then executes with bash
  • Both provided → fails with an explicit error
  • Neither provided → graceful no-op

Temp file is always cleaned up via trap.

Example usage

// devcontainer.json
{
  "features": {
    "ghcr.io/devcontainer-community/devcontainer-features/run-script:1": {
      "script": "apt-get install -y vim && echo 'done' > /tmp/setup-complete"
    }
  }
}
// or via URL
{
  "features": {
    "ghcr.io/devcontainer-community/devcontainer-features/run-script:1": {
      "url": "https://example.com/my-setup.sh"
    }
  }
}

Files

  • src/run-script/devcontainer-feature.jsonurl and script string options (both default "")
  • src/run-script/install.sh — install logic
  • src/run-script/NOTES.md — feature documentation
  • test/run-script/test.sh — autogenerated test (default empty options → no-op path)
  • README.md — entry added alphabetically after ripgrep

Copilot AI linked an issue Mar 31, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add run-script feature for executing scripts from URL or text Add run-script feature Mar 31, 2026
Copilot AI requested a review from sebst March 31, 2026 08:29
@sebst sebst marked this pull request as ready for review March 31, 2026 08:31
@sebst sebst merged commit e0d1df5 into main Mar 31, 2026
7 checks passed
@sebst sebst deleted the copilot/add-run-script-feature branch March 31, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "run-script" feature

2 participants