Skip to content

Spoje-NET/prxtodo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

prxtodo - GitHub PR to Microsoft To Do Integration

This Node.js Express server acts as a backend for a GitHub App. It receives webhook events for pull requests and creates or completes tasks in Microsoft To Do using the Microsoft Graph API.

Features

  • Receives GitHub webhook events for pull requests (opened, closed)
  • Creates a new To Do task when a PR is opened (task name = PR title, link = PR URL)
  • Marks the corresponding To Do task as completed when a PR is closed
  • Basic logging and error handling

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd prxtodo
  2. Install dependencies

    npm install express body-parser axios dotenv
  3. Create a .env file in the project root:

    GRAPH_API_TOKEN=your_microsoft_graph_api_token
    TODO_LIST_ID=your_todo_list_id
    PORT=3000 # optional, default is 3000

Configuration

  • GRAPH_API_TOKEN: OAuth 2.0 Bearer token for Microsoft Graph API with permissions to manage To Do tasks.
  • TODO_LIST_ID: The ID of the Microsoft To Do list where tasks will be created/completed.
  • PORT: (Optional) Port for the Express server (default: 3000).

Usage

  1. Start the server

    node server.js
  2. Configure your GitHub App/Webhook

    • Set the webhook URL to http://<your-server-domain>:<port>/webhook
    • Select the pull_request event
  3. On PR opened: A new To Do task is created with the PR title and link. On PR closed: The corresponding task is marked as completed.

How to Obtain Required Tokens

1. Microsoft Graph API Token

  • Register an Azure AD application at https://portal.azure.com > Azure Active Directory > App registrations.
  • Add API permissions: Tasks.ReadWrite for Microsoft To Do.
  • Grant admin consent for the permissions.
  • Use OAuth 2.0 to obtain an access token for the app/user. You can use tools like Microsoft Graph Explorer or your own OAuth flow.
  • Set the token as GRAPH_API_TOKEN in your .env file.

2. Microsoft To Do List ID

  • Use Microsoft Graph API to list your To Do lists:
    curl -H "Authorization: Bearer <GRAPH_API_TOKEN>" \
      "https://graph.microsoft.com/v1.0/me/todo/lists"
  • Find the id of the list you want to use and set it as TODO_LIST_ID in your .env file.

Example .env file

GRAPH_API_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOi...
TODO_LIST_ID=AAMkAGVmM2...
PORT=3000

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published