GitHub Actions Certification

Custom Actions

Sharing Custom Actions

In this article, we’ll publish our JavaScript action to the GitHub Marketplace. You’ll complete each required step: accepting terms, enabling two-factor authentication (2FA), updating the action metadata, and finally releasing your action.

First, open your repository to confirm the action you plan to share. Here’s our public js-action-pr-giphy-comment repository with no releases yet:

The image shows a GitHub repository page titled "js-action-pr-giphy-comment," displaying files like `.gitignore`, `README.md`, and `index.js`. The repository is public with no stars or forks.


Step 1: Start a New Release

  1. Navigate to the Releases tab and click Create a new release.
  2. Scroll down to review and accept the Marketplace terms.

Note

Publishing to the GitHub Marketplace requires two-factor authentication (2FA). If prompted, enable 2FA in your GitHub account settings and refresh the page.

  1. GitHub will check that your action’s name is unique. If it’s already taken, you’ll see an alert:

The image shows a GitHub interface for creating a new release of a project, with a warning that the action.yml file needs changes because the name must be unique. There are also tagging suggestions and semantic versioning information on the right.


Step 2: Update Your Metadata (action.yml)

Edit your action.yml (or action.yaml) to ensure you have a unique name and include all required fields:

name: 'KodeKloud Giphy PR Comment'
description: 'Automatically add a Giphy GIF comment to new pull requests.'

inputs:
  github-token:
    description: 'GitHub token with repo access'
    required: true
  giphy-api-key:
    description: 'Your Giphy API key'
    required: true

runs:
  using: 'node20'
  main: 'dist/index.js'

branding:
  icon: 'award'
  color: 'green'

Now commit and push your changes:

git add action.yml
git commit -m "chore: update action metadata and branding"
git push origin main

The image shows a GitHub interface with a "Commit changes" dialog open, where a user is entering a commit message for updating the "action.yml" file.


Step 3: Finalize and Publish the Release

Retry creating the release:

  1. Click Create a new release again.
  2. Accept the Marketplace terms.
  3. Confirm all checklist items turn green before proceeding.

The image shows a GitHub interface for releasing an action to the GitHub Marketplace, with details about the action named "KodeKloud Giphy PR Comment." It includes a checklist confirming all required information is present and provides tagging and semantic versioning suggestions.

Fill in the release details:

FieldExample
Tag versionv1.0.0-alpha
Target branchmain
Release titleAlpha Release
Release notesThis is a demo action for PR GIF comments.

The image shows a GitHub release creation page with fields for description, icon, color, and categories, along with a section for writing release notes.

Publish your release. Once complete, you’ll see download options and your new Marketplace URL.

The image shows a GitHub release page for an "Alpha Release" of a project, with options to download the source code in zip and tar.gz formats. It mentions that this is a test action used for demo purposes.


Step 4: Verify in the Marketplace

Visit the Marketplace URL to ensure your action is live and discoverable:

The image shows a GitHub Marketplace page for a GitHub Action called "KodeKloud Giphy PR Comment," which is a sample action for demo purposes. It includes details like the version, a link to use the latest version, and contributor information.

Next Steps

Enhance your README.md with detailed usage examples and workflow snippets. Then, consumers can use your action like this:

steps:
  - uses: kodekloud/[email protected]
    with:
      github-token: \${{ secrets.GITHUB_TOKEN }}
      giphy-api-key: \${{ secrets.GIPHY_API_KEY }}

That’s it! Your JavaScript GitHub Action is now published on the Marketplace and ready for users worldwide.


Watch Video

Watch video content

Previous
Create a Javascript Action