You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a number of operations that I would like to execute within the container. There are node tests, linting, type checking, building, python tests and linting and type checking... that's arguably a lot of stuff. Yet, currently everything goes into a single step in GitHub actions - the container build step.
Rather than define everything in the runCmd property, I would like to be able to define basic steps as
steps:
- name: Run node tests
run: pnpm run test
- name: Linting
run: pnpm run lint
...
And that would end up in separate steps within GitHub actions.
Reacted by Torsten Marco Lüdtke-Knodt and adamscybot
That makes sense! You want to modularize your GitHub Actions workflow by breaking down your current runCmd monolithic script into separate, easily understandable steps. By doing this, you can better organize and manage each task individually, as well as improve readability and debugging in case something fails.
You can define your steps in the workflow.yml file under the jobs section. Here’s an approach where each operation (node tests, linting, Python tests, etc.) is defined in separate steps.
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
container:
image: your-container-image:latest # Replace with your container image
steps:
- name: Checkout code
uses: actions/checkout@v3
# Node.js related tasks
- name: Install Node dependencies
run: pnpm install
- name: Run Node tests
run: pnpm run test
# Additional build or deployment steps can go here
Hope this info helps you define the steps!
Please feel free to reach out again in case of any further queries.
The above isn't practical because the GHA container feature will just do a docker run with the image, Even if you built that image earlier using devcontainer build CLI directly (or via this Github Action). Unless you use the devcontainer CLI to spin up the container using devcontainer up, you will be missing things (hooks, mount configs, probs other stuff I don't know about).
Unless you duplicate that configuration by copying that config into the GHA workflow as parameters to the container creation. And that defeats the purpose of this GitHub action, which I believe is to centralise all of that in one canonical place, eliminating the need for this.
Activity
sireeshajonnalagadda commentedon Jul 16, 2025
Hi Kamil Janowski (@kamiljano),
Thank you for reaching out!
That makes sense! You want to modularize your GitHub Actions workflow by breaking down your current runCmd monolithic script into separate, easily understandable steps. By doing this, you can better organize and manage each task individually, as well as improve readability and debugging in case something fails.
You can define your steps in the workflow.yml file under the jobs section. Here’s an approach where each operation (node tests, linting, Python tests, etc.) is defined in separate steps.
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
container:
image: your-container-image:latest # Replace with your container image
Hope this info helps you define the steps!
Please feel free to reach out again in case of any further queries.
Thanks,
Sireesha
adamscybot commentedon Sep 14, 2025
The above isn't practical because the GHA
containerfeature will just do adocker runwith the image, Even if you built that image earlier usingdevcontainer buildCLI directly (or via this Github Action). Unless you use the devcontainer CLI to spin up the container usingdevcontainer up, you will be missing things (hooks, mount configs, probs other stuff I don't know about).Unless you duplicate that configuration by copying that config into the GHA workflow as parameters to the container creation. And that defeats the purpose of this GitHub action, which I believe is to centralise all of that in one canonical place, eliminating the need for this.
However....
🎉The workaround
I figured it out. I posted it over on this issue over here, which is the same thing as this one.