diff --git a/.github/docker/Dockerfile b/.github/docker/Dockerfile index 80baade..9b650f3 100644 --- a/.github/docker/Dockerfile +++ b/.github/docker/Dockerfile @@ -70,3 +70,9 @@ RUN echo 'local({ \ RUN Rscript -e 'install.packages("pak")' COPY install-packages.R /tmp/install-packages.R RUN Rscript /tmp/install-packages.R && rm /tmp/install-packages.R + +# GitHub Copilot's injected "Prepare Copilot" step uses `set -o pipefail` via +# `shell: sh`, which dash (Debian's default /bin/sh) doesn't support. Redirect +# /bin/sh to bash, which is already installed and is a superset of POSIX sh. +# Placed last so no apt postinst script can overwrite the symlink during build. +RUN ln -sf /bin/bash /bin/sh diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index d5dffcf..7830bdb 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -15,6 +15,7 @@ jobs: # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. copilot-setup-steps: runs-on: ubuntu-latest + container: ghcr.io/api2r/pkgskills-ci:release permissions: contents: read @@ -24,6 +25,7 @@ jobs: - uses: ./.github/workflows/install with: + use-container: "true" token: ${{ secrets.GITHUB_TOKEN }} cache-version: copilot needs: build, check, website diff --git a/NEWS.md b/NEWS.md index 30d50a2..782bd2a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # pkgskills (development version) +* `use_github_copilot()` now installs a container-based `copilot-setup-steps.yml` for faster agent startup (#67). * `AGENTS.md` and `tdd-workflow` skill instructions now explicitly explain how to determine the GitHub issue number and warn agents never to guess or invent one (@copilot, #61). * `use_agent()` template is reconciled with this package's `AGENTS.md` file (#59). * `tdd-workflow` skill now documents `stbl::expect_pkg_error_snapshot()` with an explicit `package` argument instead of a helper-defined version (#51). diff --git a/inst/templates/workflows/copilot-setup-steps.yml b/inst/templates/workflows/copilot-setup-steps.yml index e299ee3..fb03545 100644 --- a/inst/templates/workflows/copilot-setup-steps.yml +++ b/inst/templates/workflows/copilot-setup-steps.yml @@ -15,6 +15,7 @@ jobs: # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. copilot-setup-steps: runs-on: ubuntu-latest + container: ghcr.io/api2r/pkgskills-ci:release permissions: contents: read @@ -24,6 +25,7 @@ jobs: - uses: ./.github/workflows/install with: + use-container: "true" token: ${{ secrets.GITHUB_TOKEN }} cache-version: copilot needs: build, check, website