tj-actions / changed-files

:octocat: Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.
MIT License
1.86k stars 191 forks source link

[Feature] Add support for previous_sha and current_sha outputs #2371

Open gm42 opened 11 hours ago

gm42 commented 11 hours ago

Is this feature missing in the latest version?

Is your feature request related to a problem? Please describe.

Not related to a problem. I have seen that the action text output tells about which SHAs were used for the comparison:

Retrieving changes between b21edcea84825a0829e057c58fe245e6ca5a00df (main) → 92fbd4595dcaf9a1e2e92723247ce4f38a926817 (feat/my-branch)

This corresponds to this line of code: https://github.com/tj-actions/changed-files/blob/05f0aba931687dcad284e6c7f2e049c258a53fb8/src/main.ts#L131C46-L131C57

Describe the solution you'd like?

It would be great if I could extract these values via outputs, to re-use them in other steps.

Describe alternatives you've considered?

One can use ${{ github.event.pull_request.base.sha }} and ${{ github.event.pull_request.head.sha }} instead.

Anything else?

No response

Code of Conduct

tj-actions-bot commented 11 hours ago

Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience.