diff --git a/action.yml b/action.yml index 9d77d02..39da63c 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,8 @@ inputs: required: false description: "The encoding for the output values, either 'string' (default) or 'json'." outputs: + changed: + description: "Indicates whether a file has changed (boolean)" files_created: description: "The names of the newly created files" files_updated: diff --git a/src/main.ts b/src/main.ts index a7f118f..79eb8c1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -107,6 +107,14 @@ async function run(): Promise { const encoder = getEncoder(); + let hasChanged = false; + const totalModified = + changedFiles.created.length + changedFiles.updated.length + changedFiles.deleted.length; + if (totalModified > 0) { + hasChanged = true; + } + + core.setOutput("changed", String(hasChanged)); core.setOutput("files_created", encoder(changedFiles.created)); core.setOutput("files_updated", encoder(changedFiles.updated)); core.setOutput("files_deleted", encoder(changedFiles.deleted));