Background
Updating a plugin that others actively use is tedious by hand: modify the code, bump the version, push changes, create a branch, package the file, and open a PR—every release. Plugin Auto-PR is a GitHub Actions workflow that automates the whole sequence. One push packages the plugin and opens the Marketplace PR, so you can focus on building.Concepts
GitHub Actions
GitHub Actions automates development tasks in GitHub. When triggered (for example, by a code push), it runs your workflow in a cloud-based virtual machine, handling everything from build to deployment.
- Public repositories: Unlimited.
- Private repositories: 2000 minutes per month.
Plugin Auto-PR
The workflow runs these steps:- Triggers when you push code to the main branch of your plugin source repository.
- Reads plugin information from the
manifest.yamlfile. - Packages the plugin as a
.difypkgfile. - Pushes the packaged file to your forked
dify-pluginsrepository. - Creates a new branch and commits the changes.
- Creates a PR to merge into the upstream repository.
Prerequisites
Repositories
- Your own plugin source code repository (e.g.,
your-name/plugin-source). - Your own fork of the plugin repository (e.g.,
your-name/dify-plugins). - The plugin directory structure already in place in your fork:
Permissions
Create a GitHub Personal Access Token (PAT) that can push code to your forked repository and create PRs to the upstream repository.Parameters and Configuration
Setup Requirements
Auto-publishing needs two things in place. Themanifest.yaml file drives the automation:
name: Your plugin’s name (affects package and branch names).version: Semantic version number (increment with each release).author: Your GitHub username (determines repository paths).
PLUGIN_ACTION secret in your plugin source repository holds the credentials:
- Value: A Personal Access Token (PAT) with sufficient permissions.
- Permissions: Push branches to your forked repository and create PRs to the upstream repository.
Automatically Generated Parameters
Once set up, the workflow derives these parameters for you:- GitHub username: Read from the
authorfield inmanifest.yaml. - Author folder name: Matches the
authorfield. - Plugin name: Read from the
namefield inmanifest.yaml. - Branch name:
bump-{plugin-name}-plugin-{version}. - Package filename:
{plugin-name}-{version}.difypkg. - PR title and content: Generated from the plugin name and version.
Step-by-Step Guide
Prepare Repositories
Ensure you have forked the official
dify-plugins repository and have your own plugin source repository.Configure Secret
In your plugin source repository, go to Settings > Secrets and variables > Actions > New repository secret and create a secret:
- Name:
PLUGIN_ACTION - Value: A GitHub Personal Access Token (PAT) with write permissions to the target repository (
your-name/dify-plugins)

Create Workflow File
Create a
.github/workflows/ directory in your repository, add a file named plugin-publish.yml, and paste in the workflow below.At a high level, the workflow runs on every push to main, downloads the Dify CLI, packages the plugin from the manifest, checks out your dify-plugins fork, and opens a PR against langgenius/dify-plugins with the new .difypkg.Complete workflow YAML
Complete workflow YAML
Usage Guide
First-Time Setup
Before the first automated release, confirm that:- You have forked the official
dify-pluginsrepository. - Your plugin source repository structure is correct.
- The
PLUGIN_ACTIONsecret is set in your plugin source repository. - The workflow file
.github/workflows/plugin-publish.ymlexists. - The
nameandauthorfields inmanifest.yamlare configured correctly.
Subsequent Updates
To publish new versions after setup:- Modify the code.
-
Update the
versionfield inmanifest.yaml.
- Push all changes to the main branch.
- Wait for GitHub Actions to complete packaging, branch creation, and PR submission.
Outcome
When you push code to the main branch of your plugin source repository, GitHub Actions runs the publishing process automatically:- Packages the plugin in
{plugin-name}-{version}.difypkgformat. - Pushes the packaged file to the target repository.
- Creates a PR to merge into the fork repository.

Example Repository
See the example repository for a working configuration and best practices.Edit this page | Report an issue