Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
arrow-right-circle

GitHub Action

Command Docker GitHub Action

v1.0.0

Command Docker GitHub Action

arrow-right-circle

Command Docker GitHub Action

A simple GitHub Action for running a shell command via a Docker container

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Command Docker GitHub Action

uses: cliffano/command-docker-action@v1.0.0

Learn more about this action in cliffano/command-docker-action

Choose a version

Avatar

Build Status Security Status

Command Docker GitHub Action

A simple GitHub Action for running a shell command via a Docker container.

The command will be executed on a directory containing the GitHub repository content.

Usage

Looping through a space-separated list of items:

jobs:
  build:
    steps:
      - name: 'Execute cat /etc/*-release using default sh shell via default alpine Docker container'
        uses: cliffano/command-docker-action@main
        with:
          command: 'cat /etc/*-release'
      - name: 'Execute cat /etc/*-release using bash shell via Ubuntu 22.04 Docker container'
        uses: cliffano/command-docker-action@main
        with:
          command: 'cat /etc/*-release'
          image: ubuntu:22.04
          shell: bash
      - name: 'Execute cat /etc/*-release using bash shell via Rocky Linux 9.3 Docker container'
        uses: cliffano/command-docker-action@main
        with:
          command: 'cat /etc/*-release'
          image: rockylinux:9.3
          shell: bash

Configuration

Input Type Description Required Default Example
command string Shell command to be executed via a Docker container Yes - cat /etc/*-release
image string Docker image to be used for running the container No alpine:3.20 ubuntu:22.04
shell string Shell to be used for running the command No sh sh, bash