Skip to content

swytchcodehq/Github-issue-integration-with-swytchcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Issue Integration Setup

This repository demonstrates how to use the Swytchcode CLI and TypeScript SDK to interact with the GitHub API to dynamically create issues.

Prerequisites

  • Node.js (v18 or higher)
  • A GitHub account

Setup Instructions

1. Install Swytchcode CLI

First, install the Swytchcode CLI globally on your machine:

npm install -g swytchcode

2. Fork and Clone

Fork this repository to your own account, then clone it locally:

git clone https://github.com/<YOUR_GITHUB_USERNAME>/github-issue-swytchcode.git
cd github-issue-swytchcode

3. Install Dependencies

Install the local project packages and download the Swytchcode integration:

npm install
swytchcode bootstrap

4. Configure Environment

  1. Copy the .env.example file to create a new .env file:
    cp .env.example .env
  2. Generate a Personal Access Token (PAT) with repo permissions:
  3. Open .env and paste your PAT.

5. Run the Script

Execute the main script:

npm run dev

The script automatically detects your forked repository URL and uses your PAT to create a test issue on it. Check the terminal output for the link to your newly created issue.

Troubleshooting

  • GITHUB_PAT is not set: Ensure you renamed .env.example to .env.
  • Could not read git remote: Ensure you ran the script from inside the cloned git repository folder.
  • 401 Unauthorized / Bad Credentials: Your token may be invalid. Generate a new one and update .env.
  • 404 Not Found / Permission Denied: Ensure your token has the repo scope enabled.

About

A hands-on TypeScript project demonstrating how to dynamically raise GitHub issues using the Swytchcode CLI and Node SDK. Perfect for automation workflows.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors