Skip to content

[BUG] action fails when with a Git tag instead of branch #995

Closed
@gpomykala

Description

@gpomykala

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

action fails when pipeline is ran with a git tag rather than branch ie.
fatal: couldn't find remote ref refs/heads/v1.68.8
It most likely fails in 1 of these:
https://github.com/tj-actions/changed-files/blob/main/diff-sha.sh#L63
https://github.com/tj-actions/changed-files/blob/main/diff-sha.sh#L173
https://github.com/tj-actions/changed-files/blob/main/diff-sha.sh#L223

To Reproduce

i was able to reproduce locally on any repo with

git fetch -u --progress origin +refs/heads/tag_name:refs/remotes/origin/tag_name 

What OS are you seeing the problem on?

all

Expected behavior?

should not crash

Relevant log output

Run # "Calculating the previous and current SHA..."
changed-files-diff-sha
  Verifying git version...
  Valid git version found: (2.39.2)
  Running on a push event...
  Fetching remote refs...
  fatal: couldn't find remote ref refs/heads/v1.68.8

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

github-actions

github-actions commented on Feb 20, 2023

@github-actions
Contributor

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

jackton1

jackton1 commented on Feb 20, 2023

@jackton1
Contributor

@gpomykala This should be resolved in the latest release also note that the base_sha is now determined automatically and should only be set if you have a different use-case in which case be sure to fetch any prior history which includes the specific tag when using the default fetch-depth of the checkout action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @gpomykala@jackton1

      Issue actions

        [BUG] action fails when with a Git tag instead of branch · Issue #995 · tj-actions/changed-files