Skip to content

Commit

Permalink
Merge pull request #162 from Expensify/maria-fix-pr-checklist
Browse files Browse the repository at this point in the history
Fix for button to add PR checklist to pull requests
  • Loading branch information
arosiclair authored Jun 23, 2023
2 parents dc01cb2 + 05d38ae commit 41f4340
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#1.2.13
- Improve the regex that fetches the repository name, owner and issue number from the current URL work for pull requests as well

#1.2.12
- Fetch repository name, owner and issue number from URL instead of relying on the DOM

Expand Down
2 changes: 1 addition & 1 deletion assets/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "K2 for GitHub",
"version": "1.2.12",
"version": "1.2.13",
"description": "Manage your Kernel Scheduling from directly inside GitHub",

"browser_specific_settings": {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "k2-extension",
"version": "1.2.12",
"version": "1.2.13",
"description": "A Chrome Extension for Kernel Schedule",
"private": true,
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/js/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ function getCurrentUser() {

/**
* Returns the name of the repository, the repo owner and the issue number from the current url for calls to the Github API
* Issue URLs are in the format: github.com/<repoName>/<owner>/issues/<issue-number> Example: https://github.com/Expensify/App/issues/16640
* PR URLs are in the format: github.com/<repoName>/<owner>/pulls/<issue-number> Example: https://github.com/Expensify/App/pull/21242
*
* @returns {Object}
*/
function getRequestParams() {
const url = window.location.href;
const regex = /github.com\/(\w*)\/(\w*)\/issues\/(\d*)/;
const regex = /github.com\/(\w*)\/(\w*)\/(?:issues|pull)\/(\d*)/;
const matches = url.match(regex);

return {
Expand Down

0 comments on commit 41f4340

Please sign in to comment.