Skip to main content
Learn how to import and run a Docker-based GitHub Action from one repository in another. In this guide, we’ll reuse the docker-action-pr-giphy-comment action in the solar-system project to automatically post a GIF response on pull requests.
The image shows a GitHub repository page for "docker-action-pr-giphy-comment," displaying files and recent commits.

1. Switch to the Target Repository

Open the solar-system repository where you want to integrate the custom action.
This image shows a GitHub repository page named "solar-system" with various files and folders listed, including workflows, images, and Kubernetes. The repository has 55 commits and a recent pull request merge.

2. Store Your Giphy API Key

To fetch GIFs, the action requires a Giphy API key stored as a secret.
  1. Navigate to Settings → Secrets and variables → Actions.
  2. Click New repository secret.
  3. Name it GIPHY_API_KEY and paste your API key.
The image shows a GitHub repository settings page focused on "Actions secrets and variables," displaying options for managing environment and repository secrets.
The image shows a GitHub repository settings page where a new secret named "GIPHY_API" is being added, with a secret key entered in the field.
Never expose your API keys in code or logs. Repository secrets are encrypted and only available to workflows.

3. Create a Pull Request Workflow

Under .github/workflows/, add a new file named pr-thank-you-workflow.yml:
Replace sidd-harth-7/docker-action-pr-giphy-comment@main with your own owner/repo@branch reference.

Job Configuration

Commit to a new branch and open a pull request:
The image shows a GitHub interface where a user is proposing changes with a commit message and options to create a new branch or commit directly to an existing branch.

4. Monitor the Workflow Execution

Head to the Actions tab to see your workflow run.
The image shows a GitHub Actions page with a workflow file named "pr-thank-you.yml" in progress. It is part of a repository called "solar-system" under the user "sidd-harth-7".

Example Build Logs

Docker container actions build an image at runtime:
Then the container runs:
Continuous Docker builds can introduce latency. Consider using a JavaScript action for faster startup.

5. Confirm the GIF Comment

After success, your pull request will display a “Thank you” comment with a GIF:
The image shows a GitHub Actions workflow run summary for a repository, indicating that the "pr-action" job has succeeded.

Watch Video