How do I get the commits SHA of the two compared commits used in the action? #2347
Unanswered
luciano-buono
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm using the action to check if some files (changelogs) were updated in a specific branch.
If they were, I show the modified/added lines and send them to a Slack channel
This is the general idea of my workflow:
As I understand, the
since_last_remote_commit
is set to true by defaulton push
workfows.This means that a FastForward merge onto staging branch would still be checked against the last remote commit in Github, am I right?
The main problem is that my
git diff
implementation is flawed in that case. Since I'm using agit diff --unified=0 HEAD~1
this means that the
tj-actions/changed-files
will compare using the 2 correct commits, but my git diff won't.I would need to get
BASE_SHA
but the action does not provide an output with this information.Ideally, I could use something like:
git diff --unified=0 ${{ steps.changed-files.outputs.SHA_BASE }} ${{ steps.changed-files.outputs.SHA_REF }}
How could I achieve this?
Beta Was this translation helpful? Give feedback.
All reactions