Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
feat: Build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 18, 2020
1 parent 5323897 commit 2aabd61
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ inputs:
description: Env name (diff).
default: GIT_DIFF
required: false
SET_ENV_NAME_FILTERED_DIFF:
description: Env name (filtered_diff).
default: GIT_DIFF_FILTERED
required: false
SET_ENV_NAME_COUNT:
description: Env name (count).
required: false
Expand All @@ -56,6 +60,8 @@ inputs:
outputs:
diff:
description: The results of diff file names.
filtered_diff:
description: The results of diff file names.
count:
description: The number of diff files.
insertions:
Expand Down
2 changes: 1 addition & 1 deletion build.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"owner":"technote-space","repo":"get-diff-action","sha":"0bb20ccb30cc7f74b76df6fc2bb3d76f5f0e550f","ref":"refs/tags/test/v1.1.7.40990476","tagName":"test/v1.1.7.40990476","branch":"gh-actions","tags":["test/v1.1.7.40990476","test/v1.1.7","test/v1.1","test/v1"],"updated_at":"2020-02-18T03:04:14.642Z"}
{"owner":"technote-space","repo":"get-diff-action","sha":"c05e1b89edb902368c01e5192d038eaee79294fe","ref":"refs/tags/test/v1.1.7.1","tagName":"test/v1.1.7.1","branch":"gh-actions","tags":["test/v1.1.7.1","test/v1.1.7","test/v1.1","test/v1"],"updated_at":"2020-02-18T13:46:42.184Z"}
4 changes: 2 additions & 2 deletions lib/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ exports.dumpDiffs = (diffs, logger) => {
logger.endProcess();
};
exports.setResult = (diffs, logger) => {
const result = command_1.getDiffFiles(diffs);
const insertions = command_1.sumResults(diffs, item => item.insertions);
const deletions = command_1.sumResults(diffs, item => item.deletions);
logger.startProcess('Dump output');
[
{ name: 'diff', value: result, envNameSuffix: '' },
{ name: 'diff', value: command_1.getDiffFiles(diffs, false), envNameSuffix: '' },
{ name: 'filtered_diff', value: command_1.getDiffFiles(diffs, true) },
{ name: 'count', value: diffs.length },
{ name: 'insertions', value: insertions },
{ name: 'deletions', value: deletions },
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ exports.getGitDiff = (logger, context) => __awaiter(void 0, void 0, void 0, func
}), Promise.resolve([])))
.map(item => (Object.assign(Object.assign({}, item), { file: toAbsolute(item.file, workspace) })));
});
exports.getDiffFiles = (diffs) => misc_1.escape(diffs.map(item => item.file)).join(getSeparator());
exports.getDiffFiles = (diffs, filter) => misc_1.escape(diffs.filter(item => !filter || item.prefixMatched && item.suffixMatched).map(item => item.file)).join(getSeparator());
exports.sumResults = (diffs, map) => getSummaryIncludeFilesFlag() ?
diffs.map(map).reduce((acc, val) => acc + val, 0) : // eslint-disable-line no-magic-numbers
diffs.filter(item => !item.filterIgnored).map(map).reduce((acc, val) => acc + val, 0); // eslint-disable-line no-magic-numbers

0 comments on commit 2aabd61

Please sign in to comment.