Skip to content

Commit

Permalink
0.4.0 9
Browse files Browse the repository at this point in the history
  • Loading branch information
seed-of-apricot committed Oct 14, 2020
1 parent ae3789d commit 154960e
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 23 deletions.
11 changes: 1 addition & 10 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/getCommits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export const getCommits = async (): Promise<

const { repo, payload } = github.context;

console.log(payload);

const commitIds = async (): Promise<string[]> => {
if (payload.pull_request) {
return (
Expand All @@ -24,7 +22,6 @@ export const getCommits = async (): Promise<
return payload.commits.map((item: { id: string }) => item.id);
}
};
console.log(await commitIds());

return Promise.all(
(await commitIds()).map(
Expand Down
3 changes: 1 addition & 2 deletions src/getFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ export const getFiles = async (
const token = core.getInput('GITHUB_TOKEN');
const path = globToRegex(core.getInput('flagPath'), { globstar: true });
const octokit = github.getOctokit(token);
console.log(commits);

const files = commits.flatMap(item =>
item.data.files.reduce((prev, file) => {
console.log(file);
if (file.filename.match(path) !== null && file.status !== 'removed') {
return [
...prev,
Expand Down
2 changes: 0 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const main = async (): Promise<void> => {
return;
}

console.log(commits);

const summary = getSummary();
console.log('summary has been retrieved');
const files = getFiles(commits);
Expand Down
4 changes: 2 additions & 2 deletions src/processFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export const processFiles = async (
columns: true,
})
: file.data;
console.log(data);

data.map((row: { [key in string]: string }) => {
const keys = Object.keys(row).slice(1);
const keys = Object.keys(row).filter(key => key !== idColumn);
const id = row[idColumn];
keys.map(key => {
const name = () => {
Expand Down
4 changes: 1 addition & 3 deletions src/writeNewSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import stringify from 'csv-stringify/lib/sync';
import { writeFile } from 'fs';

export const writeNewSummary = async (summary: Object[]) => {
console.log(summary);
const columns = summary
.flatMap(item => Object.keys(item))
.filter((item, index, array) => array.indexOf(item) === index);
const str = stringify(summary, { header: true, columns });
console.log(str);
console.log(columns);

const path = core.getInput('summaryPath') || './summary.csv';

writeFile(path, str, () => {});
Expand Down

0 comments on commit 154960e

Please sign in to comment.