-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] "Unable to locate the current sha" when using use_fork_point
#506
Comments
Thanks for reporting this issue, don't forget to star this project to help us reach a wider audience. |
I have been doing "some" investigation (or trial and error rather). I'm not a git expert, so not sure if any of the following makes sense 😉 The documentation of I have been testing to run - name: changed-files Github Action SHA workaround
id: changed-files-sha-workaround
run: |
git fetch --no-tags -u --progress origin "main":"main"
CURRENT_SHA=$(git rev-list --no-merges -n 1 HEAD 2>&1)
echo "Current SHA: $CURRENT_SHA"
FORK_POINT=$(git name-rev --name-only "$CURRENT_SHA")
echo "Fork point: $FORK_POINT"
PREVIOUS_SHA=$(git merge-base "main" "$FORK_POINT")
echo "Previous SHA: $PREVIOUS_SHA"
echo "::set-output name=current_sha_workaround::$CURRENT_SHA"
echo "::set-output name=previous_sha_workaround::$PREVIOUS_SHA"
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v20
with:
sha: ${{ steps.changed-files-sha-workaround.outputs.current_sha_workaround }}
base_sha: ${{ steps.changed-files-sha-workaround.outputs.previous_sha_workaround }} and it seems to be working. While running with
One other thing I noted is, that in the repository I'm working with we use tags very heavily. Also, it's a relatively large repo with a lot of commits. I was wondering if tagging might have some negative influence on how |
is it possible to count all the changed files? |
After more investigation it doesn't look like the problem is actually related to this Github Action. For some reason I'm closing this, as I don't think there is anything that can be done here. |
Is there an existing issue for this?
Does this issue exist in the latest version?
Describe the bug?
Running
changed-files
action one a large mono repo "sometimes" yieldsin an un-reproducible way. Sometimes rebasing and force-pushing fixes it, sometimes merging main fixes it. But also sometimes neither of them does.
The configuration I use is
Note how
previous sha
is empty. Unfortunately this happens in private repos and I cannot share the exact workflow run.To Reproduce
Unfortunately, I couldn't find a way to reproduce this error 100% of the time.
What OS are you seeing the problem on?
ubuntu-latest or ubuntu-20.04
Expected behavior?
changed-files
should work on every workflow run.Relevant log output
Anything else?
PS: Converted from a comment in #458 as I think it's a different issue.
Code of Conduct
The text was updated successfully, but these errors were encountered: