{"id":26951548,"url":"https://github.com/preschmf/preschmf-pr-alerts","last_synced_at":"2026-04-13T13:32:47.765Z","repository":{"id":285665436,"uuid":"958798034","full_name":"preschmf/preschmf-pr-alerts","owner":"preschmf","description":"Node.js and Express tool that checks for changes in PRs with the GitHub Enterprise API and sends a message on Teams when there are changes detected.","archived":false,"fork":false,"pushed_at":"2025-04-10T05:49:38.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T06:37:46.843Z","etag":null,"topics":["express","github-enterprise","microsoft-teams","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/preschmf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-01T19:25:28.000Z","updated_at":"2025-04-10T05:49:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5a02f02-a9c1-481e-ad51-66af09528917","html_url":"https://github.com/preschmf/preschmf-pr-alerts","commit_stats":null,"previous_names":["preschmf/preschmf-pr-alerts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/preschmf/preschmf-pr-alerts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preschmf%2Fpreschmf-pr-alerts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preschmf%2Fpreschmf-pr-alerts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preschmf%2Fpreschmf-pr-alerts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preschmf%2Fpreschmf-pr-alerts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preschmf","download_url":"https://codeload.github.com/preschmf/preschmf-pr-alerts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preschmf%2Fpreschmf-pr-alerts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31754986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T13:27:56.013Z","status":"ssl_error","status_checked_at":"2026-04-13T13:21:23.512Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","github-enterprise","microsoft-teams","nodejs"],"created_at":"2025-04-03T00:16:24.527Z","updated_at":"2026-04-13T13:32:47.748Z","avatar_url":"https://github.com/preschmf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :inbox_tray: preschmf-pr-alerts\nA Node.js and Express project that checks for changes or messages in all PRs made by a user in GitHub Enterprise through the GitHub Enterprise API. If any activity is detected on a PR made by the user, a Teams chat message is sent to the user from themselves supplying links to the updates. This message is sent using the Microsoft Teams Graph API.\n\n## Why this project?\nThere are three main reasons for this project:\n* Personally, I feel that the GitHub hooks that companies use to provide alerts for Pull Request and Issue activities gets very cluttered with messages, and as a result, it becomes less useful. Teams messages are very visible, and arrive with a popup and an alert sound. I found the Teams messages this app creates result in reacting to activty faster, improving workflow speed.\n* Enterprsies do not always allow access to GitHub hooks, but must allow access to the GitHub API. This project works more universally across companies with different security policies.\n* The constraint of being limited to the GitHub API and the Microsoft Graph API was a good challenge for making this project work, and allowed me to get familiar with both APIs that are frequently used in a professional context. This is valuable for the possibility of building off of the APIs in the future.\n\n## Project Overview\n* Used the Octokit npm package to simplify requests to the GitHub Enterprise API.\n### server.js\n* Sets up the Express server.\n* Uses the GET /user GitHub API with GitHUb access token to get username automatically.\n* Sets up the polling function the project is based around. newReviewComments will be called every time interval in ms that was specified in the .env file.\n\n### newReviewComments Controller\n* Since GitHub PRs are technically issues, we get all the PRs and issues with the GET /search/issues request.\n* If there are open PRs, we check for recently updated PRs, if there are none, we save on computation and skip the rest of the function.\n* If there are PRs updated since the last poll, we make a request to get all the reviews on the PR.\n* Then we filter out the reviews made since the last poll.\n* Finally, we send ourselves a message with a list of all new reviews, and the URL for each to quickly access them.\n   * Self-chat is a special kind of chat in Microsoft Team, I found the POST /chats/48:notes/messages endpoint will send a message to yourself.\n\n## Setting Up the Project\n### Create.env file\nCreate an .env file in the root with five variables:\n* POLL_INTERVAL = Time in ms that the project will poss the GitHub Enterprise API for changes\n* PORT = Port you want the project to run on, eg: 9009\n* GITHUB_AUTH_TOKEN = GitHub auth [token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)\n* MICROSOFT_GRAPH_TOKEN = This can be easily obtained by navigating to the [Graph Explorer](developer.microsoft.com/en-us/graph/graph-explorer), signing in, and clicking \"access token\" in the request\n* GITHUB_ENTERPRSIE_BASE_URL = The base URL for your company's Enterprise GitHub, eg: https://github.mycompany.com/api/v3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreschmf%2Fpreschmf-pr-alerts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreschmf%2Fpreschmf-pr-alerts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreschmf%2Fpreschmf-pr-alerts/lists"}