Skip to content

Conversation

@bluetech
Copy link
Member

@bluetech bluetech commented Nov 8, 2025

Not sure why, but it failed without one in CI:

$ gh release create --notes-file gh-release-notes.md --verify-tag "$VERSION" dist/*
failed to run git: fatal: not a git repository (or any of the parent directories): .git

Not sure why, but it failed without one in CI:

```
$ gh release create --notes-file gh-release-notes.md --verify-tag "$VERSION" dist/*
failed to run git: fatal: not a git repository (or any of the parent directories): .git
```
@bluetech bluetech added skip news used on prs to opt out of the changelog requirement backport 9.0.x apply to PRs at any point; backports the changes to the 9.0.x branch labels Nov 8, 2025
@bluetech bluetech merged commit 4b73dca into pytest-dev:main Nov 8, 2025
33 checks passed
@patchback
Copy link

patchback bot commented Nov 8, 2025

Backport to 9.0.x: 💚 backport PR created

✅ Backport PR branch: patchback/backports/9.0.x/4b73dcab02e2414496daf2683ef870719a461ec9/pr-13891

Backported as #13899

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Nov 8, 2025
ci: `gh release create` needs a checkout
(cherry picked from commit 4b73dca)
@bluetech bluetech deleted the fix-gh-release branch November 8, 2025 22:35
@webknjaz
Copy link
Member

webknjaz commented Nov 8, 2025

@bluetech was it in CI or locally? If you have a link to the log, I could take a look.

@webknjaz
Copy link
Member

webknjaz commented Nov 8, 2025

Ah, never mind. I didn't look into the patch before commenting 🤦‍♂️
The maximum fetch depth could probably be 1, though.

@bluetech
Copy link
Member Author

bluetech commented Nov 8, 2025

@webknjaz If you know why it needs a git checkout I'd be interested to know. I assumed it would work just at the github API level.

@webknjaz
Copy link
Member

webknjaz commented Nov 8, 2025

I bet it tries to infer the current repo to interact with from that. I think you should be able to pass the repository via CLI or env vars instead.

@bluetech
Copy link
Member Author

bluetech commented Nov 8, 2025

Hmm yes that makes sense. I somehow imagined it can figure it out from context but probably not. So maybe with --repo it would have worked.

@webknjaz
Copy link
Member

webknjaz commented Nov 8, 2025

I'm pretty sure I saw --repo used when gh is called from GHA and env vars set.

Also, https://cli.github.com/manual/gh_api says this:

Placeholder values {owner}, {repo}, and {branch} in the endpoint argument will get replaced with values from the repository of the current directory or the repository specified in the GH_REPO environment variable.

@webknjaz
Copy link
Member

webknjaz commented Nov 8, 2025

https://cli.github.com/manual/gh_release_create says it supports --repo and https://cli.github.com/manual/gh_help_environment suggests you can set GH_REPO: ${{ github.repository }}. I did that in that past but can't find an example so had to check the docs.

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

Labels

backport 9.0.x apply to PRs at any point; backports the changes to the 9.0.x branch skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants