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

tagpr v1.1.1 fails with open -: no such file or directory #147

Closed
snaka opened this issue Jan 20, 2023 · 9 comments · Fixed by #148
Closed

tagpr v1.1.1 fails with open -: no such file or directory #147

snaka opened this issue Jan 20, 2023 · 9 comments · Fixed by #148

Comments

@snaka
Copy link
Sponsor

snaka commented Jan 20, 2023

Thank you for publishing this useful tool!

It worked fine until tagpr v1.1.0 in my repository.
However, after the recent release of v1.1.1, I started getting errors.

The following is an excerpt from the GitHub Actions log.

Run Songmu/tagpr@main
  with:
    version: v1.1.1
  env:
    GITHUB_TOKEN: ***
Run cd "${GITHUB_WORKSPACE}" || exit 1
  cd "${GITHUB_WORKSPACE}" || exit 1
  TEMP_PATH="$(mktemp -d)"
  PATH="${TEMP_PATH}:$PATH"
  curl -sfL https://raw.githubusercontent.com/Songmu/tagpr/main/install.sh | sh -s -- -b "$TEMP_PATH" "v1.1.1" >&1
  tagpr
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    GITHUB_TOKEN: ***
Songmu/tagpr info checking GitHub for tag 'v1.1.1'
Songmu/tagpr info found version: v1.1.1 for v1.1.1/linux/amd64
Songmu/tagpr info installed /tmp/tmp.cxQuqp5Sd0/tagpr
git [remote]
origin
git [config remote.origin.url]
https://github.com/snaka/tagpr-sandbox
git [rev-parse --is-shallow-repository]
true
git [fetch --unshallow]
From https://github.com/snaka/tagpr-sandbox
 * [new branch]      customize-pr-template -> origin/customize-pr-template
 * [new branch]      tagpr-from-v1.1.10    -> origin/tagpr-from-v1.1.10
 * [new tag]         v0.0.1                -> v0.0.1
 * [new tag]         v0.1.0                -> v0.1.0
 * [new tag]         v1.0.0                -> v1.0.0
 
 (snip)
 
082e0d5
29d14c0
git [branch -D tagpr-from-v1.1.10]
error: branch 'tagpr-from-v1.1.10' not found.
git [checkout -b tagpr-from-v1.1.10]
Switched to a new branch 'tagpr-from-v1.1.10'
open -: no such file or directory
2e7897d
Error: Process completed with exit code 1.

From the error message it looks like it is trying to open a file named -.

My .tagpr is giving - to the versionFile as shown below.
This may be related to the error, but I am not sure. ( I'll investigate the behavior some more when I have time. )

[tagpr]
        vPrefix = true
        releaseBranch = main
        versionFile = -
        changelog = false
        template = .github/tagpr/template.tmpl
@toritori0318
Copy link
Contributor

Sorry, there was an omission in the correction regarding #144.
I'll take a look now...

@toritori0318
Copy link
Contributor

Results of the survey, it seems that the determination of the following part also needs to be changed.

@Songmu
I think doing it this way will fix it. What do you think?

if tp.cfg.VersionFile() != "" &&  tp.cfg.VersionFile() != "-" {

If you are uncertain, you may want to revert once.

@Songmu
Copy link
Owner

Songmu commented Jan 20, 2023

Sorry. I missed it." -" should be treated as a special string indicating empty, not as a filename.

There is a trivial problem that a file named "-" cannot be used as a versionfile at this time, but you don't need to consider that case.

@toritori0318
Copy link
Contributor

Thanks. I'll try to fix it..

@Songmu
Copy link
Owner

Songmu commented Jan 20, 2023

It might be better to detect version files or not by the existence of a .tagpr configuration file.

@toritori0318
Copy link
Contributor

@Songmu Thank you for thinking the config design.

Is it safe to proceed with this one as a tentative response for now? > #147 (comment)

@toritori0318
Copy link
Contributor

PR #148

If it doesn't fit our design policy, we can reject it.

@toritori0318
Copy link
Contributor

Thank you for the merge.
I have confirmed that it works fine from my repository. 🎉

@snaka
Copy link
Sponsor Author

snaka commented Jan 21, 2023

I have confirmed that the issue has been resolved in my repository as well.
Thanks for the quick response! 👍

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

Successfully merging a pull request may close this issue.

3 participants