-
Hi! I'm trying to get our tool Jalapeno into some package managers. We are releasing it on behalf of our company, and thus it belongs to the company's GitHub orgasation. One consequence of this is that we are trying to get the package manager -related publishing to work using GitHub deploy keys, instead of Personal Access Tokens (to make it sure that the pipeline won't break when the token owners decides to switch jobs). The first one I configured was a homebrew tap (link to related commit): brews:
- name: jalapeno
repository:
owner: futurice
name: homebrew-jalapeno
git:
url: "[email protected]:futurice/homebrew-jalapeno.git"
private_key: "{{ .Env.HOMEBREW_TAP_PRIVATE_KEY }}" ...which worked really nicely. I had to use the Next up I decided that it's time to support our Windows users, and thus started configuring Winget support. Here's where I'm strugling. With Homebrew tap, I can just commit directly to the I tried defining the branch attribute: repository:
owner: futurice
name: winget-pkgs
branch: "{{.ProjectName}}-{{.Version}}"
git:
url: "[email protected]:futurice/winget-pkgs.git"
private_key: "{{ .Env.WINGET_PKGS_PRIVATE_KEY }}" ...but the commit went to the main branch instead of the named branch. Then I tried defining the branch in the Git URL as well: git:
url: "[email protected]:futurice/winget-pkgs.git#{{.ProjectName}}-{{.Version}}" ...but then cloning the repo didn't work. I even checked goreleaser own YAML file for some inspiration, and saw that they are not using anything extra in their token configs. I thought this sounded weird, as I had read that token's permissions are limited to the repository that contains the workflow, but I even tried that: repository:
owner: futurice
name: winget-pkgs
branch: "{{.ProjectName}}-{{.Version}}" ...and it failed as well. How should I do this? Is this even possible to accomplish using write-enabled deploy keys? For now I would really like to get this working without using user-owned PATs. I found an issue where someone had circumvented this by using tibdex/github-app-token as a helper. But shouldn't this be possible also with deploy keys? Thank you for your help in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
hmm, that is a bug I think should be fixed by #4324 |
Beta Was this translation helpful? Give feedback.
-
@caarlos0 And another question on this very same topic: How do you actually handle the GITHUB_TOKEN in your own repo? I see on mention of it whatsoever in your own .goreleaser.yaml. |
Beta Was this translation helpful? Give feedback.
-
Still continuing on the discussion on the question in the topic. It might be that I've even understood something wrongly here, but is it even possible to open a pull request with a deploy key? I started this configuration with the assumption that is possible, but after fixing the branch problem I got the Winget manifest committed to a branch in futurice/winget-pkgs, but no pull request was made to microsoft/winget-pkgs. And I'm just confused if this let's-not-use-a-PAT is even a valid path forward. |
Beta Was this translation helpful? Give feedback.
hmm, that is a bug I think
should be fixed by #4324