Publish Plugins Automatically
Background
Updating plugins that others are actively using can be tedious. Traditionally, you would need to modify code, bump versions, push changes, create branches, package files, and submit PRs manually - a repetitive process that slows down development.
Thus, we have created Plugin Auto-PR, a GitHub Actions workflow that automates the entire process. Now you can package, push, and create PRs with a single action, focusing on building great plugins.
Concepts
GitHub Actions
GitHub Actions automates your development tasks in GitHub.
How it works: When triggered (e.g., by a code push), it runs your workflow in a cloud-based virtual machine, handling everything from build to deployment automatically.

Limits:
Public repositories: Unlimited
Private repositories: 2000 minutes per month
Plugin Auto-PR
How it works:
Workflow triggers when you push code to the main branch of your plugin source repository
Workflow reads plugin information from the
manifest.yamlfileAutomatically packages the plugin as a
.difypkgfilePushes the packaged file to your forked
dify-pluginsrepositoryCreates a new branch and commits changes
Automatically creates a PR to merge into the upstream repository
Prerequisites
Repository
You already have your own plugin source code repository (e.g.,
your-name/plugin-source)You already have your own forked plugin repository (e.g.,
your-name/dify-plugins)Your forked repository already has the plugin directory structure:
Permission
This workflow requires appropriate permissions to function:
You need to create a GitHub Personal Access Token (PAT) with sufficient permissions
The PAT must have permission to push code to your forked repository
The PAT must have permission to create PRs to the upstream repository
Parameters and Configuration
Setup Requirements
To get started with auto-publishing, you will need two key components:
manifest.yaml file: This file drives the automation process:
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: You need to add this secret to your plugin source repository:
Value: Must be a Personal Access Token (PAT) with sufficient permissions
Permission: Ability to push branches to your forked repository and create PRs to the upstream repository
Automatically-Generated Parameters
Once set up, the workflow automatically handles these parameters:
GitHub username: Read from the
authorfield inmanifest.yamlAuthor folder name: Consistent with the
authorfieldPlugin name: Read from the
namefield inmanifest.yamlBranch name:
bump-{plugin-name}-plugin-{version}Package filename:
{plugin-name}-{version}.difypkgPR title and content: Automatically generated based on 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
Navigate to your plugin source repository, click Settings > Secrets and variables > Actions > New repository secret, and create a GitHub Secret:
Name:
PLUGIN_ACTIONValue: 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, create a file named plugin-publish.yml in this directory, and copy the following content into the file:
Update manifest.yaml
Ensure those following fields are correctly set:
Usage Guide
First-time Setup
When setting up the auto-publish workflow for the first time, complete these steps:
Ensure you have forked the official
dify-pluginsrepositoryEnsure your plugin source repository structure is correct
Set up the
PLUGIN_ACTION Secretin your plugin source repositoryCreate the workflow file
.github/workflows/plugin-publish.ymlEnsure the
nameandauthorfields in themanifest.yamlfile are correctly configured
Subsequent Update
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 will automatically execute the publishing process:
Package the plugin in
{plugin-name}-{version}.difypkgformatPush the packaged file to the target repository
Create a PR to merge into the fork repository

Example Repository
See example repository to understand configuration and best practices.
Last updated