Skip to content
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

git+tag fails after first install #22

Closed
rix0rrr opened this issue Mar 6, 2024 · 4 comments
Closed

git+tag fails after first install #22

rix0rrr opened this issue Mar 6, 2024 · 4 comments
Assignees

Comments

@rix0rrr
Copy link

rix0rrr commented Mar 6, 2024

My GitHub workflow file looks like this:

      - name: Install typst
        uses: baptiste0928/cargo-install@v3
        with:
          git: https://github.com/typst/typst
          tag: v0.10.0
          crate: typst-cli

First run

The first run of this workflow went perfectly:

Installing typst-cli...
  Fetching git commits for https://github.com/typst/typst...
  Resolved tag v0.10.0 to commit 70ca0d257bb4ba927f63260e20443f244e0bb58c
  Installation settings:
     repository: https://github.com/typst/typst
     commit: 70ca0d257bb4ba927f63260e20443f244e0bb58c
     path: /home/runner/.cargo-install/typst-cli
     key: cargo-install-typst-cli-70ca0d2-7d85079d63d8ab080a5b
No cached version found, installing typst-cli using cargo...
Added /home/runner/.cargo-install/typst-cli/bin to PATH.

Subsequent runs

However, all subsequent runs fail with this error:

Run baptiste0928/cargo-install@v3
  with:
    git: https://github.com/typst/typst
    tag: v0.10.0
    crate: typst-cli
    locked: true
    version: latest
Installing typst-cli...
  Fetching git commits for https://github.com/typst/typst...
  Error: Failed to resolve tag v0.10.0 for https://github.com/typst/typst

The upstream repository did not delete the tag in the mean time, it's still there: https://github.com/typst/typst/tree/v0.10.0

I imagine this is a problem with how caching is handled?

@rix0rrr
Copy link
Author

rix0rrr commented Mar 6, 2024

Looking at the source code I don't see how this could happen... and yet.

@baptiste0928 baptiste0928 self-assigned this Mar 7, 2024
@baptiste0928
Copy link
Owner

Thanks for the report. It seems that I'm not reading the git ls-remote output correctly, which causes long outputs to be truncated sometimes. I was able to reproduce the problem with typst and cargo-make, which have both a long output for ls-remote.

I will start working on a fix this week.

await exec.exec('git', ['ls-remote', repository], { outStream: commandOutput })
const commits: GitRemoteCommits = { head: '', tags: {}, branches: {} }
const lines: string[] = commandOutput.read().toString().split('\n')

@rix0rrr
Copy link
Author

rix0rrr commented Mar 7, 2024

Ohhhh! That makes sense. Good catch!

@baptiste0928
Copy link
Owner

I have released a new version with the fix (f71cc64), let me know if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants