generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from ubiquity-os-marketplace/development
Merge development into main
- Loading branch information
Showing
15 changed files
with
741 additions
and
568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { AssignedIssueScope, Context, GitHubIssueSearch } from "../types"; | ||
|
||
export async function listOrganizations(context: Context): Promise<string[]> { | ||
const { | ||
config: { assignedIssueScope }, | ||
logger, | ||
payload, | ||
} = context; | ||
|
||
if (assignedIssueScope === AssignedIssueScope.REPO || assignedIssueScope === AssignedIssueScope.ORG) { | ||
return [payload.repository.owner.login]; | ||
} else if (assignedIssueScope === AssignedIssueScope.NETWORK) { | ||
const orgsSet: Set<string> = new Set(); | ||
const urlPattern = /https:\/\/github\.com\/(\S+)\/\S+\/issues\/\d+/; | ||
|
||
const url = "https://raw.githubusercontent.com/ubiquity/devpool-directory/refs/heads/__STORAGE__/devpool-issues.json"; | ||
const response = await fetch(url); | ||
if (!response.ok) { | ||
if (response.status === 404) { | ||
throw logger.error(`Error 404: unable to fetch file devpool-issues.json ${url}`); | ||
} else { | ||
throw logger.error("Error fetching file devpool-issues.json.", { status: response.status }); | ||
} | ||
} | ||
|
||
const devpoolIssues: GitHubIssueSearch["items"] = await response.json(); | ||
devpoolIssues.forEach((issue) => { | ||
const match = issue.html_url.match(urlPattern); | ||
if (match) { | ||
orgsSet.add(match[1]); | ||
} | ||
}); | ||
|
||
return [...orgsSet]; | ||
} | ||
|
||
throw new Error("Unknown assignedIssueScope value. Supported values: ['org', 'repo', 'network']"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,9 @@ export default { | |
{ | ||
name: "Time: 1h", | ||
}, | ||
{ | ||
name: "Priority: 1 (Normal)", | ||
}, | ||
], | ||
body: "body", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.