A PowerShell module that automatically creates WordPress blog posts highlighting changes and updates from specified GitHub repositories.
- π Repository Analysis: Automatically analyzes GitHub repositories for commits, pull requests, and releases
- π Smart Content Generation: Creates structured blog posts with formatted sections for different types of changes
- π Date Tracking: Remembers when the last blog post was created to avoid duplicate content
- π§ Flexible Configuration: Supports multiple authentication methods and configuration options
- π WordPress Integration: Uses WordPress REST API for seamless blog post creation
- π Rich Formatting: Generates HTML content with proper formatting, links, and organization
- Clone or download this repository
- Import the module in PowerShell:
Import-Module ./GitHubToWordPress.psd1
# Set up GitHub and WordPress credentials
Set-GitHubToWordPressConfig -GitHubToken "ghp_your_github_token" `
-WordPressUrl "https://yourblog.com" `
-WordPressUsername "your_username" `
-WordPressPassword "your_app_password"
# Create a blog post from a GitHub repository
New-GitHubToWordPressBlogPost -RepositoryUrl "https://github.com/microsoft/powershell"
You'll need a GitHub Personal Access Token with the following permissions:
public_repo
(for public repositories)repo
(if you need access to private repositories)
Create a token at: https://github.com/settings/tokens
The module uses WordPress Application Passwords for authentication:
- Go to your WordPress admin dashboard
- Navigate to Users β Profile
- Scroll down to "Application Passwords"
- Create a new application password
- Use your WordPress username and the generated application password
Set-GitHubToWordPressConfig -GitHubToken "ghp_xxxx" `
-WordPressUrl "https://myblog.com" `
-WordPressUsername "admin" `
-WordPressPassword "xxxx xxxx xxxx xxxx"
Create a JSON configuration file:
{
"GitHubToken": "ghp_your_token_here",
"WordPressUrl": "https://yourblog.com",
"WordPressUsername": "your_username",
"WordPressPassword": "your_app_password"
}
Then load it:
Set-GitHubToWordPressConfig -ConfigFile "./config.json"
# Analyze a repository and create a blog post
New-GitHubToWordPressBlogPost -RepositoryUrl "https://github.com/owner/repo"
# Get changes since a specific date
$sinceDate = (Get-Date).AddDays(-14)
New-GitHubToWordPressBlogPost -Owner "microsoft" -Repository "powershell" -SinceDate $sinceDate
# See what the blog post would look like without publishing
New-GitHubToWordPressBlogPost -RepositoryUrl "https://github.com/owner/repo" -DryRun
# Create a draft post with custom title and tags
New-GitHubToWordPressBlogPost -RepositoryUrl "https://github.com/owner/repo" `
-PostTitle "Weekly Updates from My Project" `
-PostStatus "draft" `
-Tags @("Development", "Weekly Update") `
-Categories @("Tech News")
# Just retrieve the changes without creating a blog post
$changes = Get-GitHubRepositoryChanges -RepositoryUrl "https://github.com/owner/repo"
Write-Host "Found $($changes.Commits.Count) commits and $($changes.Releases.Count) releases"
Creates a new WordPress blog post highlighting GitHub repository changes.
Parameters:
RepositoryUrl
- GitHub repository URLOwner
/Repository
- Alternative way to specify repositorySinceDate
- Date to analyze changes sincePostTitle
- Custom blog post titlePostStatus
- WordPress post status (publish, draft, private)Tags
- Array of tags for the postCategories
- Array of categories for the postDryRun
- Preview mode without publishing
Retrieves changes from a GitHub repository since a specified date.
Configures GitHub and WordPress credentials and settings.
Returns current configuration status.
The generated blog posts include the following sections:
- π New Releases - Recent releases with descriptions
- π Recent Merged Pull Requests - Successfully merged PRs
- π§ Active Pull Requests - Open PRs still under review
- π Recent Activity - Summary of commits and latest changes
- PowerShell 5.1 or later (Windows PowerShell or PowerShell Core)
- Internet connectivity for GitHub and WordPress API access
- GitHub Personal Access Token
- WordPress site with REST API enabled
- WordPress Application Password
-
Authentication Errors
- Verify your GitHub token has the correct permissions
- Ensure WordPress Application Password is correct
- Check that WordPress REST API is enabled
-
No Changes Found
- Verify the repository URL is correct
- Check the date range being analyzed
- Ensure the repository has recent activity
-
WordPress Publishing Errors
- Verify WordPress URL is correct and accessible
- Check that your WordPress user has publishing permissions
- Ensure Application Passwords are enabled in WordPress
Enable verbose output to see detailed operation information:
New-GitHubToWordPressBlogPost -RepositoryUrl "https://github.com/owner/repo" -Verbose
This project is provided as-is under the MIT License. See LICENSE file for details.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.