GitHub Actions

Custom Actions

Sharing Custom Actions

In this lesson, you’ll publish your JavaScript action to the GitHub Marketplace. We’ve already built three custom actions—composite, Docker container, and JavaScript—and now it’s time to share our PR Giphy Comment action with the world.

Repository Overview

Navigate to your repository on GitHub. You should see these key files:

FilePurpose
.gitignoreExcludes files from version control
README.mdProject overview and usage instructions
index.jsEntry point for the JavaScript logic
action.ymlMetadata for GitHub Actions and Marketplace

Prerequisites

Before publishing, make sure you have:

  • Accepted the GitHub Marketplace Terms
  • Enabled Two-Factor Authentication (2FA) on your account

Note

GitHub requires 2FA for all Marketplace publishers. If you haven’t set it up yet, follow the prompts under Settings → Security → Two-factor authentication.

Initial Publishing Attempt

When you click Create new release, GitHub validates your action.yml. Common errors include:

  • A non-unique name field
  • Missing branding section (icon or color)

Warning

If you see “Action name must be unique” or “Branding information missing,” update your action.yml before you can publish.

Update action.yml Metadata

Open action.yml in your editor and ensure the following fields are defined:

FieldDescriptionExample
nameUnique identifier for your actionKodeKloud Giphy PR Comment
descriptionShort summary of what the action doesAdd a Giphy GIF comment to PRs
inputsRequired parameters (token, API keys, etc.)github-token, giphy-api-key
runsRuntime environment and entry pointusing node20, main dist/index.js
brandingMarketplace icon and coloricon award, color green

Here’s a complete example configuration:

name: 'KodeKloud Giphy PR Comment'
description: 'Add a Giphy GIF comment to new pull requests.'
inputs:
  github-token:
    description: 'GitHub Token'
    required: true
  giphy-api-key:
    description: 'Giphy API Key'
    required: true
runs:
  using: 'node20'
  main: 'dist/index.js'
branding:
  icon: 'award'
  color: 'green'

Commit and push these changes to your feature branch.

Create a Release

  1. On GitHub, click Create new release.
  2. Enter the Tag (e.g., 1.0.0-alpha), Title (e.g., Alpha Release), and a brief Description (e.g., “Demo release for the Giphy PR comment action.”).
  3. Publish the release.

Consider using Semantic Versioning for your tags.

Verify Release Downloads

After publishing, the release page will display download links:

  • Source code (ZIP)
  • Source code (tar.gz)

Ensure both links are available—this confirms your release artifacts are correctly packaged.

View the Marketplace Listing

Your action is now live! Click the View it on GitHub Marketplace link provided on the release page to see the “KodeKloud Giphy PR Comment” listing. You can further enhance your listing by adding:

  • Usage examples
  • Detailed configuration instructions
  • Screenshots or GIFs

We’ll use this published action in one of our upcoming workflows.

Watch Video

Watch video content

Previous
Create a Javascript Action