Skip to content

Ability to define steps within the plugin #293

Description

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.

Activity

  1. sireeshajonnalagadda commented on Jul 16, 2025

    @sireeshajonnalagadda

    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

    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.

    Thanks,
    Sireesha

  2. adamscybot commented on Sep 14, 2025

    @adamscybot

    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.

    However....

    🎉The workaround

    I figured it out. I posted it over on this issue over here, which is the same thing as this one.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions