diff --git a/__tests__/process.test.ts b/__tests__/process.test.ts index 1a43993e..704f4761 100644 --- a/__tests__/process.test.ts +++ b/__tests__/process.test.ts @@ -99,11 +99,12 @@ describe('setResult', () => { stdoutCalledWith(mockStdout, [ '::group::Dump output', - '::set-output name=diff::test1 test2', - '::set-env name=GIT_DIFF::test1 test2', - '"diff: test1 test2"', - '::set-output name=diff_all::test1 test2 test4', - '"diff_all: test1 test2 test4"', + '::set-output name=diff::test1 test2 test4', + '::set-env name=GIT_DIFF::test1 test2 test4', + '"diff: test1 test2 test4"', + '::set-output name=filtered_diff::test1 test2', + '::set-env name=GIT_DIFF_FILTERED::test1 test2', + '"filtered_diff: test1 test2"', '::set-output name=count::3', '"count: 3"', '::set-output name=insertions::3', @@ -128,10 +129,11 @@ describe('setResult', () => { stdoutCalledWith(mockStdout, [ '::group::Dump output', - '::set-output name=diff::test1 test2', - '"diff: test1 test2"', - '::set-output name=diff_all::test1 test2 test4', - '"diff_all: test1 test2 test4"', + '::set-output name=diff::test1 test2 test4', + '"diff: test1 test2 test4"', + '::set-output name=filtered_diff::test1 test2', + '::set-env name=GIT_DIFF_FILTERED::test1 test2', + '"filtered_diff: test1 test2"', '::set-output name=count::3', '::set-env name=FILE_COUNT::3', '"count: 3"', @@ -242,8 +244,9 @@ describe('execute', () => { '::set-output name=diff::\'package.json\' \'abc/composer.json\' \'README.md\' \'src/main.ts\'', '::set-env name=GIT_DIFF::\'package.json\' \'abc/composer.json\' \'README.md\' \'src/main.ts\'', '"diff: \'package.json\' \'abc/composer.json\' \'README.md\' \'src/main.ts\'"', - '::set-output name=diff_all::\'package.json\' \'abc/composer.json\' \'README.md\' \'src/main.ts\'', - '"diff_all: \'package.json\' \'abc/composer.json\' \'README.md\' \'src/main.ts\'"', + '::set-output name=filtered_diff::\'package.json\' \'abc/composer.json\' \'README.md\' \'src/main.ts\'', + '::set-env name=GIT_DIFF_FILTERED::\'package.json\' \'abc/composer.json\' \'README.md\' \'src/main.ts\'', + '"filtered_diff: \'package.json\' \'abc/composer.json\' \'README.md\' \'src/main.ts\'"', '::set-output name=count::4', '"count: 4"', '::set-output name=insertions::100', @@ -273,8 +276,9 @@ describe('execute', () => { '::set-output name=diff::', '::set-env name=GIT_DIFF::', '"diff: "', - '::set-output name=diff_all::', - '"diff_all: "', + '::set-output name=filtered_diff::', + '::set-env name=GIT_DIFF_FILTERED::', + '"filtered_diff: "', '::set-output name=count::0', '"count: 0"', '::set-output name=insertions::0', @@ -317,8 +321,9 @@ describe('execute', () => { '::set-output name=diff::', '::set-env name=GIT_DIFF::', '"diff: "', - '::set-output name=diff_all::', - '"diff_all: "', + '::set-output name=filtered_diff::', + '::set-env name=GIT_DIFF_FILTERED::', + '"filtered_diff: "', '::set-output name=count::0', '"count: 0"', '::set-output name=insertions::0', diff --git a/action.yml b/action.yml index 28ea1917..59e356ed 100644 --- a/action.yml +++ b/action.yml @@ -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 @@ -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: diff --git a/src/process.ts b/src/process.ts index 77a09299..d3c6161a 100644 --- a/src/process.ts +++ b/src/process.ts @@ -16,8 +16,8 @@ export const setResult = (diffs: DiffResult[], logger: Logger): void => { logger.startProcess('Dump output'); [ - {name: 'diff', value: getDiffFiles(diffs, true), envNameSuffix: ''}, - {name: 'diff_all', value: getDiffFiles(diffs, false)}, + {name: 'diff', value: getDiffFiles(diffs, false), envNameSuffix: ''}, + {name: 'filtered_diff', value: getDiffFiles(diffs, true)}, {name: 'count', value: diffs.length}, {name: 'insertions', value: insertions}, {name: 'deletions', value: deletions},