From 2948cdc577d7fe713e1c561879fd0b6240fd6aae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 18:02:04 +0000 Subject: [PATCH 1/2] Initial plan From 72873fb453198a6a9a9b68823a8703c2fea6415a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 18:09:08 +0000 Subject: [PATCH 2/2] Improve Actions workflow: PR tests only affected features, 60-min timeout, least-privilege permissions Co-authored-by: sebst <592313+sebst@users.noreply.github.com> Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/cce341b7-4c9d-4fd6-8cce-cc5c56573b13 --- .github/workflows/test.yaml | 133 +++++++++++------------------------- 1 file changed, 38 insertions(+), 95 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3519f58..fc209fc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,60 +6,45 @@ on: pull_request: workflow_dispatch: +permissions: + contents: read + jobs: + get-changed-features: + runs-on: ubuntu-latest + outputs: + features: ${{ steps.filter.outputs.features }} + has-features: ${{ steps.filter.outputs.has-features }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "Detect changed features" + id: filter + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + git fetch origin ${{ github.base_ref }} + FEATURES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD \ + | grep -E '^(src|test)/' \ + | sed -E 's#^(src|test)/([^/]+)/.*#\2#' \ + | sort -u \ + | jq -R -s -c 'split("\n") | map(select(length > 0))') + else + FEATURES=$(ls src/ | sort | jq -R -s -c 'split("\n") | map(select(length > 0))') + fi + echo "features=$FEATURES" >> $GITHUB_OUTPUT + echo "has-features=$(echo "$FEATURES" | jq '. | length > 0')" >> $GITHUB_OUTPUT + test-autogenerated: + needs: get-changed-features + if: needs.get-changed-features.outputs.has-features == 'true' runs-on: ubuntu-latest + timeout-minutes: 60 continue-on-error: true strategy: matrix: - features: - - alexpasmantier-television - - asdf-vm.com - - astral.sh-uv - - atuin.sh - - aws-cli - - bat - - biomejs.dev - - btop - - bun.sh - - charmbracelet-gum - - chezmoi.io - - cloudflare.com-warp-cli - - delta - - deno.com - - dozzle.dev - - devenv.sh - - fd - - feature-installer - - fzf - - github.com-cli - - helix-editor.com - - jj-vcs.dev - - jnsahaj-lumen - - lazygit - - jq - - k9scli.io - - mosh.org - - keybase.io - - neovim.io - - nixos.org - - nvidia.com-cuda - - opencode.ai - - pi.dev - - pkgx.sh - - pulumi.com - - rclone.org - - restic.net - - ripgrep - - smallstep.com - - starship.rs - - swc.rs - - sshd - - tailscale.com - - webinstall.dev - - yq - - zellij.dev - - zyedidia-eget + features: ${{ fromJson(needs.get-changed-features.outputs.features) }} baseImage: - debian:latest - ubuntu:latest @@ -74,57 +59,14 @@ jobs: run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . test-scenarios: + needs: get-changed-features + if: needs.get-changed-features.outputs.has-features == 'true' runs-on: ubuntu-latest + timeout-minutes: 60 continue-on-error: true strategy: matrix: - features: - - alexpasmantier-television - - asdf-vm.com - - astral.sh-uv - - atuin.sh - - bat - - biomejs.dev - - btop - - bun.sh - - charmbracelet-gum - - chezmoi.io - - cloudflare.com-warp-cli - - delta - - deno.com - - dozzle.dev - - devenv.sh - - fd - - feature-installer - - fzf - - github.com-cli - - helix-editor.com - - jj-vcs.dev - - jnsahaj-lumen - - lazygit - - jq - - k9scli.io - - mosh.org - - keybase.io - - neovim.io - - nixos.org - - nvidia.com-cuda - - opencode.ai - - pi.dev - - pkgx.sh - - pulumi.com - - rclone.org - - restic.net - - ripgrep - - smallstep.com - - starship.rs - - swc.rs - - sshd - - tailscale.com - - webinstall.dev - - yq - - zellij.dev - - zyedidia-eget + features: ${{ fromJson(needs.get-changed-features.outputs.features) }} steps: - uses: actions/checkout@v4 @@ -136,6 +78,7 @@ jobs: test-global: runs-on: ubuntu-latest + timeout-minutes: 60 continue-on-error: true steps: - uses: actions/checkout@v4