Skip to content

Commit

Permalink
Adding output
Browse files Browse the repository at this point in the history
  • Loading branch information
lcoutinho-cs committed Dec 6, 2024
1 parent bab30c2 commit d168654
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ outputs:
description: "Returns all modified YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and deleted (ACMRD)"
changed_keys:
description: "Returns all changed YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and renamed (ACMR)"
previous_commit_sha:
description: "Returns previous commit sha"

runs:
using: 'node20'
Expand Down
9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ const getChangedFilesFromLocalGitHistory = async ({
`Retrieving changes between ${diffResult.previousSha} (${diffResult.targetBranch}) → ${diffResult.currentSha} (${diffResult.currentBranch})`
)

await setOutput({
key: 'previous_commit_sha',
value: diffResult.previousSha,
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir,
json: inputs.json,
safeOutput: inputs.safeOutput
})

const allDiffFiles = await getAllDiffFiles({
workingDirectory,
diffSubmodule,
Expand Down

0 comments on commit d168654

Please sign in to comment.