Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4196030939 | ||
|
|
bbe796033e | ||
|
|
159562dc02 | ||
|
|
a21a533a0c | ||
|
|
eeb169a9f9 | ||
|
|
951140b94a | ||
|
|
dbf0700c7a | ||
|
|
dacbaebcaf | ||
|
|
36ab2fe9c2 | ||
|
|
7e3a4bac80 | ||
|
|
dcbe9805f4 | ||
|
|
fd73c1248c |
@@ -187,6 +187,16 @@
|
|||||||
"contributions": [
|
"contributions": [
|
||||||
"doc"
|
"doc"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "V0lantis",
|
||||||
|
"name": "Arthur",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/37664438?v=4",
|
||||||
|
"profile": "https://arthurvolant.com",
|
||||||
|
"contributions": [
|
||||||
|
"bug",
|
||||||
|
"code"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 7,
|
"contributorsPerLine": 7,
|
||||||
@@ -195,5 +205,6 @@
|
|||||||
"repoType": "github",
|
"repoType": "github",
|
||||||
"repoHost": "https://github.com",
|
"repoHost": "https://github.com",
|
||||||
"skipCi": true,
|
"skipCi": true,
|
||||||
"commitConvention": "angular"
|
"commitConvention": "angular",
|
||||||
|
"commitType": "docs"
|
||||||
}
|
}
|
||||||
|
|||||||
4
.codacy.yml
Normal file
4
.codacy.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
exclude_paths:
|
||||||
|
- "*.md"
|
||||||
|
- "dist/**"
|
||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -845,7 +845,7 @@ jobs:
|
|||||||
since_last_remote_commit: true
|
since_last_remote_commit: true
|
||||||
|
|
||||||
- name: Verify failed
|
- name: Verify failed
|
||||||
if: steps.changed-files-since-last-remote-commit.outcome != 'failure' && matrix.fetch-depth == 1 && github.event_name != 'push'
|
if: steps.changed-files-since-last-remote-commit.outcome != 'failure' && matrix.fetch-depth == 1 && github.event.action == 'closed' && github.event_name == 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
echo "Expected: (failure) got ${{ steps.changed-files-since-last-remote-commit.outcome }}"
|
echo "Expected: (failure) got ${{ steps.changed-files-since-last-remote-commit.outcome }}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
53
HISTORY.md
53
HISTORY.md
@@ -1,5 +1,58 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
# [39.1.1](https://github.com/tj-actions/changed-files/compare/v39.1.0...v39.1.1) - (2023-09-19)
|
||||||
|
|
||||||
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Changed_keys and modified_keys output to handle json and escape_json inputs ([#1585](https://github.com/tj-actions/changed-files/issues/1585)) ([951140b](https://github.com/tj-actions/changed-files/commit/951140b94a6a58dd2c62d7fb0b4d73898c79b196)) - (Arthur)
|
||||||
|
- Error with test ([#1589](https://github.com/tj-actions/changed-files/issues/1589)) ([dbf0700](https://github.com/tj-actions/changed-files/commit/dbf0700c7ac336b1ceed2ac8fe1b02d4cd3ac84f)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update test.yml ([a21a533](https://github.com/tj-actions/changed-files/commit/a21a533a0c244a27daac02f9dc6fcf8aeb996154)) - (Tonye Jack)
|
||||||
|
- Updated README.md ([#1588](https://github.com/tj-actions/changed-files/issues/1588))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([dacbaeb](https://github.com/tj-actions/changed-files/commit/dacbaebcaf9428d083702ffa9b449bac799dd2c3)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
## <!-- 3 -->📚 Documentation
|
||||||
|
|
||||||
|
- Add V0lantis as a contributor for bug ([#1587](https://github.com/tj-actions/changed-files/issues/1587)) ([36ab2fe](https://github.com/tj-actions/changed-files/commit/36ab2fe9c2c58212caac6853d9b8e205a4d5c84b)) - (allcontributors[bot])
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- Add codacy config ([#1590](https://github.com/tj-actions/changed-files/issues/1590)) ([eeb169a](https://github.com/tj-actions/changed-files/commit/eeb169a9f925d0d92ff3dea3ac356ff0d5f288a8)) - (Tonye Jack)
|
||||||
|
- Update test.yml ([#1586](https://github.com/tj-actions/changed-files/issues/1586)) ([7e3a4ba](https://github.com/tj-actions/changed-files/commit/7e3a4bac80a0d6fdd60b44fea0dc5fa781ca8177)) - (Tonye Jack)
|
||||||
|
- Move variable declaration ([#1584](https://github.com/tj-actions/changed-files/issues/1584)) ([dcbe980](https://github.com/tj-actions/changed-files/commit/dcbe9805f4bb9e5128d8c802e2517943b4c09aa0)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v39.1.0 ([#1583](https://github.com/tj-actions/changed-files/issues/1583))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([fd73c12](https://github.com/tj-actions/changed-files/commit/fd73c1248c8bebea8b243083223002698432c2a0)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [39.1.0](https://github.com/tj-actions/changed-files/compare/v39.0.3...v39.1.0) - (2023-09-18)
|
||||||
|
|
||||||
|
## <!-- 0 -->🚀 Features
|
||||||
|
|
||||||
|
- Add support for returning YAML keys for paths that have changed ([#1581](https://github.com/tj-actions/changed-files/issues/1581)) ([5db7b57](https://github.com/tj-actions/changed-files/commit/5db7b578d50867ab5781bf9d867e7650b5b39fc4)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Updated README.md ([#1582](https://github.com/tj-actions/changed-files/issues/1582))
|
||||||
|
|
||||||
|
Co-authored-by: repo-ranger[bot] <repo-ranger[bot]@users.noreply.github.com> ([8e79ba7](https://github.com/tj-actions/changed-files/commit/8e79ba7ab9fee9984275219aeb2c8db47bcb8a2d)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v6.7.2 ([a17e8c5](https://github.com/tj-actions/changed-files/commit/a17e8c5252f6c9982b161714c528708a7f445479)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([d1e9506](https://github.com/tj-actions/changed-files/commit/d1e9506b19d9c3a4053191d616b1ac09de1dfa55)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v39.0.3 ([#1577](https://github.com/tj-actions/changed-files/issues/1577))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([1fdfe09](https://github.com/tj-actions/changed-files/commit/1fdfe0928a9a55323f0d333ecf6ccfca8c6d73c9)) - (tj-actions[bot])
|
||||||
|
|
||||||
# [39.0.3](https://github.com/tj-actions/changed-files/compare/v39.0.2...v39.0.3) - (2023-09-17)
|
# [39.0.3](https://github.com/tj-actions/changed-files/compare/v39.0.2...v39.0.3) - (2023-09-17)
|
||||||
|
|
||||||
## <!-- 26 -->🔄 Update
|
## <!-- 26 -->🔄 Update
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||||
|
|
||||||
[](#contributors-)
|
[](#contributors-)
|
||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||||
|
|
||||||
@@ -1011,6 +1011,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|||||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/adonisgarciac"><img src="https://avatars.githubusercontent.com/u/71078987?v=4?s=100" width="100px;" alt="adonisgarciac"/><br /><sub><b>adonisgarciac</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Code">💻</a> <a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Documentation">📖</a></td>
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/adonisgarciac"><img src="https://avatars.githubusercontent.com/u/71078987?v=4?s=100" width="100px;" alt="adonisgarciac"/><br /><sub><b>adonisgarciac</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Code">💻</a> <a href="https://github.com/tj-actions/changed-files/commits?author=adonisgarciac" title="Documentation">📖</a></td>
|
||||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/cfernhout"><img src="https://avatars.githubusercontent.com/u/22294606?v=4?s=100" width="100px;" alt="Chiel Fernhout"/><br /><sub><b>Chiel Fernhout</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=cfernhout" title="Documentation">📖</a></td>
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/cfernhout"><img src="https://avatars.githubusercontent.com/u/22294606?v=4?s=100" width="100px;" alt="Chiel Fernhout"/><br /><sub><b>Chiel Fernhout</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=cfernhout" title="Documentation">📖</a></td>
|
||||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/albertoperdomo2"><img src="https://avatars.githubusercontent.com/u/62241095?v=4?s=100" width="100px;" alt="Alberto Perdomo"/><br /><sub><b>Alberto Perdomo</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=albertoperdomo2" title="Documentation">📖</a></td>
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/albertoperdomo2"><img src="https://avatars.githubusercontent.com/u/62241095?v=4?s=100" width="100px;" alt="Alberto Perdomo"/><br /><sub><b>Alberto Perdomo</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=albertoperdomo2" title="Documentation">📖</a></td>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://arthurvolant.com"><img src="https://avatars.githubusercontent.com/u/37664438?v=4?s=100" width="100px;" alt="Arthur"/><br /><sub><b>Arthur</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/issues?q=author%3AV0lantis" title="Bug reports">🐛</a> <a href="https://github.com/tj-actions/changed-files/commits?author=V0lantis" title="Code">💻</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
147
dist/index.js
generated
vendored
147
dist/index.js
generated
vendored
@@ -74,9 +74,9 @@ const processChangedFiles = ({ filePatterns, allDiffFiles, inputs, yamlFilePatte
|
|||||||
core.info('All Done!');
|
core.info('All Done!');
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
const modifiedKeys = [];
|
|
||||||
const changedKeys = [];
|
|
||||||
if (Object.keys(yamlFilePatterns).length > 0) {
|
if (Object.keys(yamlFilePatterns).length > 0) {
|
||||||
|
const modifiedKeys = [];
|
||||||
|
const changedKeys = [];
|
||||||
for (const key of Object.keys(yamlFilePatterns)) {
|
for (const key of Object.keys(yamlFilePatterns)) {
|
||||||
core.startGroup(`changed-files-yaml-${key}`);
|
core.startGroup(`changed-files-yaml-${key}`);
|
||||||
const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({
|
const allFilteredDiffFiles = yield (0, utils_1.getFilteredChangedFiles)({
|
||||||
@@ -101,21 +101,17 @@ const processChangedFiles = ({ filePatterns, allDiffFiles, inputs, yamlFilePatte
|
|||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
if (modifiedKeys.length > 0) {
|
if (modifiedKeys.length > 0) {
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setArrayOutput)({
|
||||||
key: 'modified_keys',
|
key: 'modified_keys',
|
||||||
value: modifiedKeys.join(inputs.separator),
|
inputs,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
value: modifiedKeys
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (changedKeys.length > 0) {
|
if (changedKeys.length > 0) {
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setArrayOutput)({
|
||||||
key: 'changed_keys',
|
key: 'changed_keys',
|
||||||
value: changedKeys.join(inputs.separator),
|
inputs,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
value: changedKeys
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -435,9 +431,6 @@ exports.setOutputsAndGetModifiedAndChangedFilesStatus = void 0;
|
|||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const changedFiles_1 = __nccwpck_require__(7358);
|
const changedFiles_1 = __nccwpck_require__(7358);
|
||||||
const utils_1 = __nccwpck_require__(918);
|
const utils_1 = __nccwpck_require__(918);
|
||||||
const getOutputKey = (key, outputPrefix) => {
|
|
||||||
return outputPrefix ? `${outputPrefix}_${key}` : key;
|
|
||||||
};
|
|
||||||
const getArrayFromPaths = (paths, inputs) => {
|
const getArrayFromPaths = (paths, inputs) => {
|
||||||
return Array.isArray(paths) ? paths : paths.split(inputs.separator);
|
return Array.isArray(paths) ? paths : paths.split(inputs.separator);
|
||||||
};
|
};
|
||||||
@@ -449,7 +442,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`Added files: ${JSON.stringify(addedFiles)}`);
|
core.debug(`Added files: ${JSON.stringify(addedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('added_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('added_files', outputPrefix),
|
||||||
value: addedFiles.paths,
|
value: addedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -457,7 +450,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('added_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('added_files_count', outputPrefix),
|
||||||
value: addedFiles.count,
|
value: addedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -469,7 +462,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`Copied files: ${JSON.stringify(copiedFiles)}`);
|
core.debug(`Copied files: ${JSON.stringify(copiedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('copied_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('copied_files', outputPrefix),
|
||||||
value: copiedFiles.paths,
|
value: copiedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -477,7 +470,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('copied_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('copied_files_count', outputPrefix),
|
||||||
value: copiedFiles.count,
|
value: copiedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -489,7 +482,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`Modified files: ${JSON.stringify(modifiedFiles)}`);
|
core.debug(`Modified files: ${JSON.stringify(modifiedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('modified_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('modified_files', outputPrefix),
|
||||||
value: modifiedFiles.paths,
|
value: modifiedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -497,7 +490,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('modified_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('modified_files_count', outputPrefix),
|
||||||
value: modifiedFiles.count,
|
value: modifiedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -509,7 +502,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`Renamed files: ${JSON.stringify(renamedFiles)}`);
|
core.debug(`Renamed files: ${JSON.stringify(renamedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('renamed_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('renamed_files', outputPrefix),
|
||||||
value: renamedFiles.paths,
|
value: renamedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -517,7 +510,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('renamed_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('renamed_files_count', outputPrefix),
|
||||||
value: renamedFiles.count,
|
value: renamedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -529,7 +522,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`Type changed files: ${JSON.stringify(typeChangedFiles)}`);
|
core.debug(`Type changed files: ${JSON.stringify(typeChangedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('type_changed_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('type_changed_files', outputPrefix),
|
||||||
value: typeChangedFiles.paths,
|
value: typeChangedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -537,7 +530,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('type_changed_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('type_changed_files_count', outputPrefix),
|
||||||
value: typeChangedFiles.count,
|
value: typeChangedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -549,7 +542,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`Unmerged files: ${JSON.stringify(unmergedFiles)}`);
|
core.debug(`Unmerged files: ${JSON.stringify(unmergedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('unmerged_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('unmerged_files', outputPrefix),
|
||||||
value: unmergedFiles.paths,
|
value: unmergedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -557,7 +550,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('unmerged_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('unmerged_files_count', outputPrefix),
|
||||||
value: unmergedFiles.count,
|
value: unmergedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -569,7 +562,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`Unknown files: ${JSON.stringify(unknownFiles)}`);
|
core.debug(`Unknown files: ${JSON.stringify(unknownFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('unknown_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('unknown_files', outputPrefix),
|
||||||
value: unknownFiles.paths,
|
value: unknownFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -577,7 +570,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('unknown_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('unknown_files_count', outputPrefix),
|
||||||
value: unknownFiles.count,
|
value: unknownFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -588,7 +581,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`All changed and modified files: ${JSON.stringify(allChangedAndModifiedFiles)}`);
|
core.debug(`All changed and modified files: ${JSON.stringify(allChangedAndModifiedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('all_changed_and_modified_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('all_changed_and_modified_files', outputPrefix),
|
||||||
value: allChangedAndModifiedFiles.paths,
|
value: allChangedAndModifiedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -596,7 +589,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('all_changed_and_modified_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('all_changed_and_modified_files_count', outputPrefix),
|
||||||
value: allChangedAndModifiedFiles.count,
|
value: allChangedAndModifiedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -613,7 +606,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`All changed files: ${JSON.stringify(allChangedFiles)}`);
|
core.debug(`All changed files: ${JSON.stringify(allChangedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('all_changed_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('all_changed_files', outputPrefix),
|
||||||
value: allChangedFiles.paths,
|
value: allChangedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -621,13 +614,13 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('all_changed_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('all_changed_files_count', outputPrefix),
|
||||||
value: allChangedFiles.count,
|
value: allChangedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('any_changed', outputPrefix),
|
key: (0, utils_1.getOutputKey)('any_changed', outputPrefix),
|
||||||
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
|
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -651,24 +644,20 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
allChangedFiles.paths.length > 0 &&
|
allChangedFiles.paths.length > 0 &&
|
||||||
filePatterns.length > 0;
|
filePatterns.length > 0;
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('only_changed', outputPrefix),
|
key: (0, utils_1.getOutputKey)('only_changed', outputPrefix),
|
||||||
value: onlyChanged,
|
value: onlyChanged,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
json: inputs.json
|
json: inputs.json
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setArrayOutput)({
|
||||||
key: getOutputKey('other_changed_files', outputPrefix),
|
key: 'other_changed_files',
|
||||||
value: inputs.json
|
inputs,
|
||||||
? otherChangedFiles
|
value: otherChangedFiles,
|
||||||
: otherChangedFiles.join(inputs.separator),
|
outputPrefix
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json,
|
|
||||||
shouldEscape: inputs.escapeJson
|
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('other_changed_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('other_changed_files_count', outputPrefix),
|
||||||
value: otherChangedFiles.length.toString(),
|
value: otherChangedFiles.length.toString(),
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -686,7 +675,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`All modified files: ${JSON.stringify(allModifiedFiles)}`);
|
core.debug(`All modified files: ${JSON.stringify(allModifiedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('all_modified_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('all_modified_files', outputPrefix),
|
||||||
value: allModifiedFiles.paths,
|
value: allModifiedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -694,13 +683,13 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('all_modified_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('all_modified_files_count', outputPrefix),
|
||||||
value: allModifiedFiles.count,
|
value: allModifiedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('any_modified', outputPrefix),
|
key: (0, utils_1.getOutputKey)('any_modified', outputPrefix),
|
||||||
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
|
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -724,24 +713,20 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
allModifiedFiles.paths.length > 0 &&
|
allModifiedFiles.paths.length > 0 &&
|
||||||
filePatterns.length > 0;
|
filePatterns.length > 0;
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('only_modified', outputPrefix),
|
key: (0, utils_1.getOutputKey)('only_modified', outputPrefix),
|
||||||
value: onlyModified,
|
value: onlyModified,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
json: inputs.json
|
json: inputs.json
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setArrayOutput)({
|
||||||
key: getOutputKey('other_modified_files', outputPrefix),
|
key: 'other_modified_files',
|
||||||
value: inputs.json
|
inputs,
|
||||||
? otherModifiedFiles
|
value: otherModifiedFiles,
|
||||||
: otherModifiedFiles.join(inputs.separator),
|
outputPrefix
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json,
|
|
||||||
shouldEscape: inputs.escapeJson
|
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('other_modified_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('other_modified_files_count', outputPrefix),
|
||||||
value: otherModifiedFiles.length.toString(),
|
value: otherModifiedFiles.length.toString(),
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -753,7 +738,7 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
});
|
});
|
||||||
core.debug(`Deleted files: ${JSON.stringify(deletedFiles)}`);
|
core.debug(`Deleted files: ${JSON.stringify(deletedFiles)}`);
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('deleted_files', outputPrefix),
|
key: (0, utils_1.getOutputKey)('deleted_files', outputPrefix),
|
||||||
value: deletedFiles.paths,
|
value: deletedFiles.paths,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -761,13 +746,13 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
shouldEscape: inputs.escapeJson
|
shouldEscape: inputs.escapeJson
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('deleted_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('deleted_files_count', outputPrefix),
|
||||||
value: deletedFiles.count,
|
value: deletedFiles.count,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('any_deleted', outputPrefix),
|
key: (0, utils_1.getOutputKey)('any_deleted', outputPrefix),
|
||||||
value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
|
value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
@@ -785,24 +770,20 @@ const setOutputsAndGetModifiedAndChangedFilesStatus = ({ allDiffFiles, allFilter
|
|||||||
deletedFiles.paths.length > 0 &&
|
deletedFiles.paths.length > 0 &&
|
||||||
filePatterns.length > 0;
|
filePatterns.length > 0;
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('only_deleted', outputPrefix),
|
key: (0, utils_1.getOutputKey)('only_deleted', outputPrefix),
|
||||||
value: onlyDeleted,
|
value: onlyDeleted,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir,
|
outputDir: inputs.outputDir,
|
||||||
json: inputs.json
|
json: inputs.json
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setArrayOutput)({
|
||||||
key: getOutputKey('other_deleted_files', outputPrefix),
|
key: 'other_deleted_files',
|
||||||
value: inputs.json
|
inputs,
|
||||||
? otherDeletedFiles
|
value: otherDeletedFiles,
|
||||||
: otherDeletedFiles.join(inputs.separator),
|
outputPrefix
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json,
|
|
||||||
shouldEscape: inputs.escapeJson
|
|
||||||
});
|
});
|
||||||
yield (0, utils_1.setOutput)({
|
yield (0, utils_1.setOutput)({
|
||||||
key: getOutputKey('other_deleted_files_count', outputPrefix),
|
key: (0, utils_1.getOutputKey)('other_deleted_files_count', outputPrefix),
|
||||||
value: otherDeletedFiles.length.toString(),
|
value: otherDeletedFiles.length.toString(),
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
outputDir: inputs.outputDir
|
outputDir: inputs.outputDir
|
||||||
@@ -1280,6 +1261,8 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
|
|||||||
sha2: currentSha,
|
sha2: currentSha,
|
||||||
diff
|
diff
|
||||||
}))) {
|
}))) {
|
||||||
|
core.warning('If this pull request is from a forked repository, please set the checkout action `repository` input to the same repository as the pull request.');
|
||||||
|
core.warning('This can be done by setting actions/checkout `repository` to ${{ github.event.pull_request.head.repo.full_name }}');
|
||||||
throw new Error(`Unable to determine a difference between ${previousSha}${diff}${currentSha}`);
|
throw new Error(`Unable to determine a difference between ${previousSha}${diff}${currentSha}`);
|
||||||
}
|
}
|
||||||
if (previousSha === currentSha) {
|
if (previousSha === currentSha) {
|
||||||
@@ -1882,7 +1865,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.hasLocalGitDirectory = exports.recoverDeletedFiles = exports.setOutput = exports.getRecoverFilePatterns = exports.getYamlFilePatterns = exports.getFilePatterns = exports.getDirNamesIncludeFilesPattern = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.getRemoteBranchHeadSha = exports.isInsideWorkTree = exports.getHeadSha = exports.gitLog = exports.getFilteredChangedFiles = exports.getAllChangedFiles = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = exports.getDirname = exports.normalizeSeparators = exports.isWindows = void 0;
|
exports.hasLocalGitDirectory = exports.recoverDeletedFiles = exports.setOutput = exports.setArrayOutput = exports.getOutputKey = exports.getRecoverFilePatterns = exports.getYamlFilePatterns = exports.getFilePatterns = exports.getDirNamesIncludeFilesPattern = exports.jsonOutput = exports.getDirnameMaxDepth = exports.canDiffCommits = exports.getPreviousGitTag = exports.verifyCommitSha = exports.getParentSha = exports.getRemoteBranchHeadSha = exports.isInsideWorkTree = exports.getHeadSha = exports.gitLog = exports.getFilteredChangedFiles = exports.getAllChangedFiles = exports.gitRenamedFiles = exports.gitSubmoduleDiffSHA = exports.getSubmodulePath = exports.gitFetchSubmodules = exports.gitFetch = exports.submoduleExists = exports.isRepoShallow = exports.updateGitGlobalConfig = exports.verifyMinimumGitVersion = exports.getDirname = exports.normalizeSeparators = exports.isWindows = void 0;
|
||||||
/*global AsyncIterableIterator*/
|
/*global AsyncIterableIterator*/
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const exec = __importStar(__nccwpck_require__(1514));
|
const exec = __importStar(__nccwpck_require__(1514));
|
||||||
@@ -2703,6 +2686,22 @@ const getRecoverFilePatterns = ({ inputs }) => {
|
|||||||
return filePatterns.filter(Boolean);
|
return filePatterns.filter(Boolean);
|
||||||
};
|
};
|
||||||
exports.getRecoverFilePatterns = getRecoverFilePatterns;
|
exports.getRecoverFilePatterns = getRecoverFilePatterns;
|
||||||
|
const getOutputKey = (key, outputPrefix) => {
|
||||||
|
return outputPrefix ? `${outputPrefix}_${key}` : key;
|
||||||
|
};
|
||||||
|
exports.getOutputKey = getOutputKey;
|
||||||
|
const setArrayOutput = ({ key, inputs, value, outputPrefix }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
core.debug(`${key}: ${JSON.stringify(value)}`);
|
||||||
|
yield (0, exports.setOutput)({
|
||||||
|
key: outputPrefix ? (0, exports.getOutputKey)(key, outputPrefix) : key,
|
||||||
|
value: inputs.json ? value : value.join(inputs.separator),
|
||||||
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
|
outputDir: inputs.outputDir,
|
||||||
|
json: inputs.json,
|
||||||
|
shouldEscape: inputs.escapeJson
|
||||||
|
});
|
||||||
|
});
|
||||||
|
exports.setArrayOutput = setArrayOutput;
|
||||||
const setOutput = ({ key, value, writeOutputFiles, outputDir, json = false, shouldEscape = false }) => __awaiter(void 0, void 0, void 0, function* () {
|
const setOutput = ({ key, value, writeOutputFiles, outputDir, json = false, shouldEscape = false }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
let cleanedValue;
|
let cleanedValue;
|
||||||
if (json) {
|
if (json) {
|
||||||
|
|||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tj-actions/changed-files",
|
"name": "@tj-actions/changed-files",
|
||||||
"version": "39.0.3",
|
"version": "39.1.1",
|
||||||
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
|
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
gitSubmoduleDiffSHA,
|
gitSubmoduleDiffSHA,
|
||||||
isWindows,
|
isWindows,
|
||||||
jsonOutput,
|
jsonOutput,
|
||||||
setOutput
|
setArrayOutput
|
||||||
} from './utils'
|
} from './utils'
|
||||||
|
|
||||||
export const processChangedFiles = async ({
|
export const processChangedFiles = async ({
|
||||||
@@ -50,10 +50,10 @@ export const processChangedFiles = async ({
|
|||||||
core.endGroup()
|
core.endGroup()
|
||||||
}
|
}
|
||||||
|
|
||||||
const modifiedKeys: string[] = []
|
|
||||||
const changedKeys: string[] = []
|
|
||||||
|
|
||||||
if (Object.keys(yamlFilePatterns).length > 0) {
|
if (Object.keys(yamlFilePatterns).length > 0) {
|
||||||
|
const modifiedKeys: string[] = []
|
||||||
|
const changedKeys: string[] = []
|
||||||
|
|
||||||
for (const key of Object.keys(yamlFilePatterns)) {
|
for (const key of Object.keys(yamlFilePatterns)) {
|
||||||
core.startGroup(`changed-files-yaml-${key}`)
|
core.startGroup(`changed-files-yaml-${key}`)
|
||||||
const allFilteredDiffFiles = await getFilteredChangedFiles({
|
const allFilteredDiffFiles = await getFilteredChangedFiles({
|
||||||
@@ -85,22 +85,18 @@ export const processChangedFiles = async ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (modifiedKeys.length > 0) {
|
if (modifiedKeys.length > 0) {
|
||||||
await setOutput({
|
await setArrayOutput({
|
||||||
key: 'modified_keys',
|
key: 'modified_keys',
|
||||||
value: modifiedKeys.join(inputs.separator),
|
inputs,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
value: modifiedKeys
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changedKeys.length > 0) {
|
if (changedKeys.length > 0) {
|
||||||
await setOutput({
|
await setArrayOutput({
|
||||||
key: 'changed_keys',
|
key: 'changed_keys',
|
||||||
value: changedKeys.join(inputs.separator),
|
inputs,
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
value: changedKeys
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,7 @@ import {
|
|||||||
getChangeTypeFiles
|
getChangeTypeFiles
|
||||||
} from './changedFiles'
|
} from './changedFiles'
|
||||||
import {Inputs} from './inputs'
|
import {Inputs} from './inputs'
|
||||||
import {setOutput} from './utils'
|
import {getOutputKey, setArrayOutput, setOutput} from './utils'
|
||||||
|
|
||||||
const getOutputKey = (key: string, outputPrefix: string): string => {
|
|
||||||
return outputPrefix ? `${outputPrefix}_${key}` : key
|
|
||||||
}
|
|
||||||
|
|
||||||
const getArrayFromPaths = (
|
const getArrayFromPaths = (
|
||||||
paths: string | string[],
|
paths: string | string[],
|
||||||
@@ -283,15 +279,11 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
|
|||||||
json: inputs.json
|
json: inputs.json
|
||||||
})
|
})
|
||||||
|
|
||||||
await setOutput({
|
await setArrayOutput({
|
||||||
key: getOutputKey('other_changed_files', outputPrefix),
|
key: 'other_changed_files',
|
||||||
value: inputs.json
|
inputs,
|
||||||
? otherChangedFiles
|
value: otherChangedFiles,
|
||||||
: otherChangedFiles.join(inputs.separator),
|
outputPrefix
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json,
|
|
||||||
shouldEscape: inputs.escapeJson
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await setOutput({
|
await setOutput({
|
||||||
@@ -376,15 +368,11 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
|
|||||||
json: inputs.json
|
json: inputs.json
|
||||||
})
|
})
|
||||||
|
|
||||||
await setOutput({
|
await setArrayOutput({
|
||||||
key: getOutputKey('other_modified_files', outputPrefix),
|
key: 'other_modified_files',
|
||||||
value: inputs.json
|
inputs,
|
||||||
? otherModifiedFiles
|
value: otherModifiedFiles,
|
||||||
: otherModifiedFiles.join(inputs.separator),
|
outputPrefix
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json,
|
|
||||||
shouldEscape: inputs.escapeJson
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await setOutput({
|
await setOutput({
|
||||||
@@ -457,15 +445,11 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
|
|||||||
json: inputs.json
|
json: inputs.json
|
||||||
})
|
})
|
||||||
|
|
||||||
await setOutput({
|
await setArrayOutput({
|
||||||
key: getOutputKey('other_deleted_files', outputPrefix),
|
key: 'other_deleted_files',
|
||||||
value: inputs.json
|
inputs,
|
||||||
? otherDeletedFiles
|
value: otherDeletedFiles,
|
||||||
: otherDeletedFiles.join(inputs.separator),
|
outputPrefix
|
||||||
writeOutputFiles: inputs.writeOutputFiles,
|
|
||||||
outputDir: inputs.outputDir,
|
|
||||||
json: inputs.json,
|
|
||||||
shouldEscape: inputs.escapeJson
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await setOutput({
|
await setOutput({
|
||||||
|
|||||||
@@ -551,6 +551,12 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
diff
|
diff
|
||||||
}))
|
}))
|
||||||
) {
|
) {
|
||||||
|
core.warning(
|
||||||
|
'If this pull request is from a forked repository, please set the checkout action `repository` input to the same repository as the pull request.'
|
||||||
|
)
|
||||||
|
core.warning(
|
||||||
|
'This can be done by setting actions/checkout `repository` to ${{ github.event.pull_request.head.repo.full_name }}'
|
||||||
|
)
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unable to determine a difference between ${previousSha}${diff}${currentSha}`
|
`Unable to determine a difference between ${previousSha}${diff}${currentSha}`
|
||||||
)
|
)
|
||||||
|
|||||||
26
src/utils.ts
26
src/utils.ts
@@ -1222,6 +1222,32 @@ export const getRecoverFilePatterns = ({
|
|||||||
return filePatterns.filter(Boolean)
|
return filePatterns.filter(Boolean)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getOutputKey = (key: string, outputPrefix: string): string => {
|
||||||
|
return outputPrefix ? `${outputPrefix}_${key}` : key
|
||||||
|
}
|
||||||
|
|
||||||
|
export const setArrayOutput = async ({
|
||||||
|
key,
|
||||||
|
inputs,
|
||||||
|
value,
|
||||||
|
outputPrefix
|
||||||
|
}: {
|
||||||
|
key: string
|
||||||
|
inputs: Inputs
|
||||||
|
value: string[]
|
||||||
|
outputPrefix?: string
|
||||||
|
}): Promise<void> => {
|
||||||
|
core.debug(`${key}: ${JSON.stringify(value)}`)
|
||||||
|
await setOutput({
|
||||||
|
key: outputPrefix ? getOutputKey(key, outputPrefix) : key,
|
||||||
|
value: inputs.json ? value : value.join(inputs.separator),
|
||||||
|
writeOutputFiles: inputs.writeOutputFiles,
|
||||||
|
outputDir: inputs.outputDir,
|
||||||
|
json: inputs.json,
|
||||||
|
shouldEscape: inputs.escapeJson
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const setOutput = async ({
|
export const setOutput = async ({
|
||||||
key,
|
key,
|
||||||
value,
|
value,
|
||||||
|
|||||||
@@ -972,9 +972,9 @@
|
|||||||
"@types/braces" "*"
|
"@types/braces" "*"
|
||||||
|
|
||||||
"@types/node@*", "@types/node@^20.3.2":
|
"@types/node@*", "@types/node@^20.3.2":
|
||||||
version "20.6.2"
|
version "20.6.3"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.2.tgz#a065925409f59657022e9063275cd0b9bd7e1b12"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.3.tgz#5b763b321cd3b80f6b8dde7a37e1a77ff9358dd9"
|
||||||
integrity sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==
|
integrity sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==
|
||||||
|
|
||||||
"@types/semver@^7.3.12", "@types/semver@^7.5.0":
|
"@types/semver@^7.3.12", "@types/semver@^7.5.0":
|
||||||
version "7.5.2"
|
version "7.5.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user