Custom Actions & Marketplace
Explore the GitHub Actions Marketplace for pre-built actions and learn how to create your own custom actions.
Custom Actions & Marketplace is a free DevOps Bootcamp lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Discover GitHub Actions Marketplace
Welcome to the GitHub Actions Marketplace! It's a vibrant hub where you can find thousands of pre-built actions created by GitHub, open-source contributors, and commercial partners.
These actions can be easily integrated into your workflows, saving you time and effort by reusing existing solutions for common tasks.
Finding the Right Action
Navigating the Marketplace is straightforward. You can search for actions by keywords, filter by category (like 'CI/CD' or 'Deployment'), and sort by popularity.
- Look for actions with high star ratings and active maintenance.
- Check the action's documentation for usage instructions, inputs, and outputs.
- Review the number of times an action has been used in public repositories for social proof.
Integrate a Ready-Made Action
Using a Marketplace action is simple. You reference it using the uses keyword in your workflow YAML, followed by the action's owner/repo@version.
A common example is actions/checkout, which checks out your repository code so your workflow can access it.
name: Marketplace Demo
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Say hello
run: echo "Hello from workflow!"Action Inputs & Outputs
Many actions accept inputs to customize their behavior, specified using the with keyword. They can also produce outputs that other steps in your workflow can use.
For example, the actions/setup-node action can take a node-version input.
name: Node Setup Demo
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install dependencies
run: npm installWhen to Build Your Own Action
While the Marketplace offers a lot, sometimes you need something specific. That's when custom actions come in handy!
You might build a custom action for:
- Automating internal company tools.
- Integrating with a unique API not covered by existing actions.
- Performing highly specialized tasks specific to your project's build process.
Custom Action Types
There are two main types of custom actions you can create:
- JavaScript Actions: These run directly on the runner machine using Node.js. They are often quicker to develop and easier to share.
- Docker Container Actions: These run inside a Docker container. They're great for encapsulating environments and dependencies, ensuring consistent execution across different runners.
We'll focus on JavaScript actions for simplicity.
The `action.yml` File
Every custom action needs an action.yml file. This file defines the action's metadata, including its name, description, inputs it accepts, outputs it produces, and how it runs.
It's like the manifest for your action, telling GitHub Actions everything it needs to know.
name: 'My Custom Greeting Action'
description: 'Greets a person with a custom message.'
inputs:
who-to-greet:
description: 'Who to greet'
required: true
default: 'World'
outputs:
time:
description: 'The time we greeted you'
runs:
using: 'node16'
main: 'index.js'Building a Simple JavaScript Action
Let's create a very basic JavaScript action. You'll need an index.js file (specified in action.yml) and usually a package.json for dependencies.
The @actions/core package is essential for interacting with the workflow, like getting inputs and setting outputs.
const core = require('@actions/core');
async function run() {
try {
const nameToGreet = core.getInput('who-to-greet');
console.log(`Hello ${nameToGreet}!`);
const time = (new Date()).toTimeString();
core.setOutput("time", time);
} catch (error) {
core.setFailed(error.message);
}
}
run();Integrating Your Custom Action
To use your custom action, place its files (action.yml, index.js, etc.) in a subdirectory within your repository. Then, reference it in your workflow using a relative path with uses: ./path/to/your/action.
This allows you to test your action locally before potentially publishing it to the Marketplace.
name: Use Custom Action Demo
on: [push]
jobs:
greet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run my custom action
uses: ./my-custom-action # Path to action directory
with:
who-to-greet: 'CoddyKit User'
- name: Get the output time
run: echo "The greeting time was ${{ steps.run-my-custom-action.outputs.time }}"Custom Action Components
You've learned about the key elements involved in creating and using custom GitHub Actions. Let's test your understanding!
Marketplace & Custom Actions Recap
Great job! You've explored the power of both the GitHub Actions Marketplace and custom actions.
- The Marketplace offers a wealth of ready-to-use actions to streamline your workflows.
- Custom actions allow you to extend GitHub Actions to meet unique project or organizational needs.
By combining these, you can build incredibly powerful and tailored automation pipelines!
Frequently asked questions
Is the “Custom Actions & Marketplace” lesson free?
Yes — the full text of “Custom Actions & Marketplace” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.
What will I learn in “Custom Actions & Marketplace”?
Explore the GitHub Actions Marketplace for pre-built actions and learn how to create your own custom actions. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start DevOps Bootcamp?
No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Custom Actions & Marketplace” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this DevOps Bootcamp lesson?
Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Introduction to GitHub Actions
- Building CI/CD Workflows
- Custom Actions & Marketplace
- Secrets and Environment Variables in Actions