Add command to fix templates (#21)
* add command to fix templates * replaceAll and lint fixes * fixed menu * fix lint command and run it * add basic error handling for listing of templates * CR suggestions --------- Co-authored-by: Arwid Thornström <arwidt@gmail.com>
This commit is contained in:
co-authored by
Arwid Thornström
parent
bc9ba08e76
commit
724f3905ab
@@ -6,7 +6,7 @@ export const getOrgRepos = async (toolbox, token, org) => {
|
||||
try {
|
||||
const response = await octokit.request('GET /orgs/{org}/repos', {
|
||||
org: org,
|
||||
per_page: 100
|
||||
per_page: 100,
|
||||
});
|
||||
if (response.status === 200) {
|
||||
return response.data;
|
||||
@@ -23,7 +23,7 @@ export const getRepo = async (toolbox, token, owner, repo) => {
|
||||
try {
|
||||
const response = await octokit.request('GET /repos/{owner}/{repo}', {
|
||||
owner: owner,
|
||||
repo: repo
|
||||
repo: repo,
|
||||
});
|
||||
if (response.status === 200) {
|
||||
return response.data;
|
||||
@@ -45,7 +45,7 @@ export const getRepoBranches = async (toolbox, token, owner, repo) => {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
page: page,
|
||||
per_page: 100
|
||||
per_page: 100,
|
||||
}
|
||||
);
|
||||
return response;
|
||||
@@ -70,9 +70,9 @@ export const getRepoBranches = async (toolbox, token, owner, repo) => {
|
||||
export const getOrgIssues = async (toolbox, token) => {
|
||||
// const { print } = toolbox;
|
||||
const repos = await getOrgRepos(toolbox, token, 'Photowall');
|
||||
const repoNames = repos.map(item => item.name);
|
||||
const repoNames = repos.map((item) => item.name);
|
||||
const allIssues = await Promise.all(
|
||||
repoNames.map(async repoName => {
|
||||
repoNames.map(async (repoName) => {
|
||||
const issues = await getOpenIssuesFromRepo(toolbox, token, repoName);
|
||||
// console.log(`${repoName} - issues`, issues.length);
|
||||
// return issues.map(item => `${item.number}-${item.title.substring(0, 10)}`);
|
||||
@@ -89,7 +89,7 @@ export const getOpenIssuesFromRepo = async (toolbox, token, repo) => {
|
||||
const response = await octokit.request('GET /repos/{owner}/{repo}/issues', {
|
||||
owner: 'Photowall',
|
||||
repo: repo,
|
||||
per_page: 100
|
||||
per_page: 100,
|
||||
});
|
||||
if (response.status === 200) {
|
||||
return response.data;
|
||||
@@ -109,7 +109,7 @@ export const getIssueFromRepo = async (toolbox, token, repo, issueNumber) => {
|
||||
{
|
||||
owner: 'Photowall',
|
||||
repo: repo,
|
||||
issue_number: issueNumber
|
||||
issue_number: issueNumber,
|
||||
}
|
||||
);
|
||||
if (response.status === 200) {
|
||||
@@ -134,7 +134,7 @@ export const createPullRequest = async (
|
||||
owner: 'Photowall',
|
||||
repo: repo,
|
||||
head: branch,
|
||||
base: 'master'
|
||||
base: 'master',
|
||||
});
|
||||
console.log(`response`, response);
|
||||
// if (response.status === 200) {
|
||||
|
||||
Reference in New Issue
Block a user