github-docker-action

Create Docker container actions for GitHub Actions with Dockerfile, action.yml metadata, and entrypoint scripts. Use when building custom GitHub Actions with Docker, scaffolding container-based actions, or debugging Docker action workflows.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "github-docker-action" with this command: npx skills add kjanat/skills/kjanat-skills-github-docker-action

GitHub Docker Container Action

Build, package, and test custom GitHub Actions using Docker containers.

Not what you need? For running sidecar services (Redis, PostgreSQL, etc.) in CI workflows, see the github-service-containers skill.

Prerequisites

  • Repository on GitHub (public, internal, or private)
  • Basic understanding of GitHub Actions and Docker
  • Self-hosted runners must run Linux with Docker installed

Security: Always treat workflow inputs as untrusted. Avoid script injection via ${{ }} in run: blocks.

Workflow: Creating a Docker Action

Step 1: Create project structure

my-action/
├── Dockerfile
├── action.yml
├── entrypoint.sh
└── README.md

Step 2: Write Dockerfile

See dockerfile-patterns.md

Minimal:

FROM alpine:3.21
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

Step 3: Define action metadata

See action-metadata.md

Declare inputs, outputs, and Docker configuration in action.yml.

Step 4: Write entrypoint script

See entrypoint-scripts.md

Script receives inputs as positional args. Write outputs to $GITHUB_OUTPUT.

Step 5: Make entrypoint executable

git add entrypoint.sh
git update-index --chmod=+x entrypoint.sh

Verify: git ls-files --stage entrypoint.sh should show 100755.

Step 6: Tag and push

git add action.yml entrypoint.sh Dockerfile README.md
git commit -m "Initial action release"
git tag -a -m "v1 release" v1
git push --follow-tags

Step 7: Test in a workflow

See workflow-testing.md

Quick Reference

ComponentPurpose
DockerfileContainer image definition
action.ymlAction metadata (inputs, outputs, runner)
entrypoint.shCode executed when container starts
README.mdUsage docs for action consumers

Key environment variables

VariableDescription
$GITHUB_OUTPUTFile to write output key=value pairs
$GITHUB_WORKSPACERepo checkout dir (maps to /github/workspace in container)
$GITHUB_ENVFile to set env vars for later steps

Container filesystem mapping

The runner maps GITHUB_WORKSPACE to /github/workspace in the container. Files written there are available to subsequent workflow steps.

Reading Order

TaskFiles to Read
Scaffold new actionSKILL.md (this file)
Dockerfile questionsdockerfile-patterns.md
Configure inputs/outputsaction-metadata.md
Write entrypoint logicentrypoint-scripts.md
Test in workflowworkflow-testing.md
Debug container issuesdockerfile-patterns.md + entrypoint-scripts.md

In This Reference

FilePurpose
dockerfile-patterns.mdDockerfile templates and gotchas
action-metadata.mdaction.yml spec and examples
entrypoint-scripts.mdEntrypoint, outputs, permissions
workflow-testing.mdWorkflow YAML for public/private

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

github-script

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

github-service-containers

No summary provided by upstream source.

Repository SourceNeeds Review
General

changelog-writing

No summary provided by upstream source.

Repository SourceNeeds Review