mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-07 16:49:03 +00:00
Add "changes" output variable to support matrix job configuration
This commit is contained in:
parent
84e1697bff
commit
9e8c9af501
5 changed files with 67 additions and 4 deletions
10
dist/index.js
vendored
10
dist/index.js
vendored
|
@ -4791,10 +4791,12 @@ async function getChangedFilesFromApi(token, pullRequest) {
|
|||
}
|
||||
function exportResults(results, format) {
|
||||
core.info('Results:');
|
||||
const changes = [];
|
||||
for (const [key, files] of Object.entries(results)) {
|
||||
const value = files.length > 0;
|
||||
core.startGroup(`Filter ${key} = ${value}`);
|
||||
if (files.length > 0) {
|
||||
changes.push(key);
|
||||
core.info('Matching files:');
|
||||
for (const file of files) {
|
||||
core.info(`${file.filename} [${file.status}]`);
|
||||
|
@ -4809,6 +4811,14 @@ function exportResults(results, format) {
|
|||
core.setOutput(`${key}_files`, filesValue);
|
||||
}
|
||||
}
|
||||
if (results['changes'] === undefined) {
|
||||
const changesJson = JSON.stringify(changes);
|
||||
core.info(`Changes output set to ${changesJson}`);
|
||||
core.setOutput('changes', changesJson);
|
||||
}
|
||||
else {
|
||||
core.info('Cannot set changes output variable - name already used by filter output');
|
||||
}
|
||||
core.endGroup();
|
||||
}
|
||||
function serializeExport(files, format) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue