GitHub Issues Sync Action
Bidirectional sync between GitHub issues and local markdown files with YAML frontmatter, enabling version-controlled issue management.
What this file does
Bidirectional sync between GitHub issues and local markdown files with YAML frontmatter, enabling version-controlled issue management.
When to use it
- Want to manage GitHub issues as local markdown files under version control
- Need to sync issues between a GitHub repo and a local directory for offline editing
- Building a workflow that requires pulling issues into files or pushing file changes back to GitHub
- Looking for a ready-made GitHub Action to automate issue synchronization
Assumes this stack
GitHub Issues Sync Action
Overview
This project is a GitHub Action that provides bidirectional synchronization between GitHub issues and local markdown files. It allows teams to manage GitHub issues locally using markdown files with YAML frontmatter, enabling version control of issues and integration with local development workflows.
System Architecture
Core Architecture
- Node.js Application: Built on Node.js 20 runtime
- GitHub Actions Framework: Uses @actions/core and @actions/github for GitHub integration
- File-based Storage: Issues stored as markdown files with YAML frontmatter
- Bidirectional Sync: Supports pull (GitHub → Local), push (Local → GitHub), or both directions
Key Design Decisions
- Markdown + YAML Format: Chosen for human readability and version control compatibility
- Directory Organization: Issues organized into
open/andclosed/subdirectories for clarity - Conflict Resolution: Multiple strategies (fail, create-files, overwrite) to handle sync conflicts
- Comprehensive Metadata: Preserves all GitHub issue metadata including labels, assignees, milestones
Key Components
Entry Point (src/index.js)
- Main orchestrator that handles input validation and sync direction routing
- Manages error handling and output reporting
- Coordinates between pull and push sync operations
Sync Operations
- Pull Sync (
src/sync/pull.js): Downloads issues from GitHub to local markdown files - Push Sync (
src/sync/push.js): Uploads local markdown files to GitHub as issues - Conflict Resolver (
src/sync/conflict-resolver.js): Handles conflicts between local and remote versions
Parsers
- GitHub Parser (
src/parsers/github-parser.js): Converts GitHub API responses to markdown format - Markdown Parser (
src/parsers/markdown-parser.js): Converts markdown files to GitHub API format
Utilities
- File Utils (
src/utils/file-utils.js): File system operations and directory management - GitHub API (
src/utils/github-api.js): GitHub API client initialization - Logger (
src/utils/logger.js): Centralized logging with debug mode support - Validation (
src/utils/validation.js): Input validation and security checks
Data Flow
Pull Sync Flow
- Fetch all issues from GitHub repository using REST API
- Parse each issue into markdown format with YAML frontmatter
- Check for existing local files and detect conflicts
- Apply conflict resolution strategy (fail, create conflict files, or overwrite)
- Write issues to organized directory structure (
open/orclosed/)
Push Sync Flow
- Scan local directories for markdown issue files
- Parse markdown files to extract issue data and metadata
- Check if issue exists on GitHub (via github_id in frontmatter)
- Create new issues or update existing ones via GitHub API
- Update local files with GitHub-generated metadata
File Structure
.github/issues/
├── open/
│ ├── 1-issue-title.md
│ └── 2-another-issue.md
└── closed/
└── 3-resolved-issue.md
External Dependencies
GitHub APIs
- GitHub REST API: Primary interface for issue management
- GitHub Actions Framework: Runtime environment and utilities
- Octokit: GitHub API client with pagination support
Node.js Packages
- @actions/core: GitHub Actions toolkit for inputs/outputs
- @actions/github: GitHub context and API access
- front-matter: YAML frontmatter parsing
- fs-extra: Enhanced file system operations
- js-yaml: YAML serialization/deserialization
Authentication
- Uses GitHub token (typically
${{ secrets.GITHUB_TOKEN }}) for API access - Requires repository read/write permissions for issues
Deployment Strategy
GitHub Actions Deployment
- Distributed as a composite GitHub Action
- Uses Node.js 20 runtime environment
- Can be triggered via schedule, workflow dispatch, or repository events
- Runs in GitHub-hosted runners (ubuntu-latest recommended)
Configuration Options
- Sync Direction: pull, push, or both
- Issues Path: Configurable directory for issue storage
- Conflict Strategy: Multiple approaches for handling conflicts
- Debug Mode: Enhanced logging for troubleshooting
Security Considerations
- Path traversal protection in validation layer
- Token-based authentication with minimal required permissions
- Input sanitization for all user-provided values
Recent Changes
- June 26, 2025: Completed full GitHub Issues Sync Action implementation
- All core synchronization functionality working
- Bidirectional sync (pull from GitHub, push to GitHub)
- Comprehensive conflict resolution system
- Complete metadata preservation (labels, assignees, milestones, comments)
- Organized file structure with open/closed directories
- Full validation and error handling
- Debug logging support
- Created demo files and comprehensive documentation
Demo Files Created
.github/issues/open/1-fix-login-validation-bug.md- Sample new issue.github/issues/closed/42-update-api-documentation.md- Sample synced issue.github/workflows/sync-issues.yml- Example workflow configurationdemo-setup.js- Demonstration script showing functionality
Changelog
- June 26, 2025: Initial setup and complete implementation
- June 26, 2025: Added comprehensive documentation and demo
User Preferences
Preferred communication style: Simple, everyday language.
What's inside
6 core source files, 4 utility modules, 2 parsers, 1 conflict resolver, and 3 demo files
Change this for your project
- Replace
lmcrean/github-issues-syncwith your own repository name in the workflow file - Replace
.github/issues/with your desired local path for issue storage - Replace
${{ secrets.GITHUB_TOKEN }}with your own token if using a different secret name
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Organizing issues into
open/andclosed/subdirectories for clarity - Using YAML frontmatter in markdown files to preserve full GitHub issue metadata
- Offering multiple conflict resolution strategies (fail, create-files, overwrite) for sync robustness
Related Documents
GOOBY - Closing Store Marketplace
Defines a full-stack marketplace app for discovering closing retail stores in NY/NJ/CT/PA, with automated closure scanning and admin review.
Lua Code Obfuscator/Deobfuscator
Provides a full-stack web app for obfuscating and deobfuscating Roblox Lua scripts with a Monaco editor and PostgreSQL storage.
GREEN NODE - Project Overview
Describes a full-stack recycling platform with three runtime modes, provider architecture, and development scripts for Cochabamba, Bolivia.
ADN Systems DMR Peer Server
Documents a forked FreeDMR server for amateur radio DMR voice/data routing with bridges, proxies, scheduled voice announcements, and centralized security.