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

Why cannot GitHub PAT be used for AUR? #4735

Closed
3 tasks done
bartekpacia opened this issue Mar 29, 2024 · 7 comments
Closed
3 tasks done

Why cannot GitHub PAT be used for AUR? #4735

bartekpacia opened this issue Mar 29, 2024 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@bartekpacia
Copy link
Contributor

bartekpacia commented Mar 29, 2024

Is your feature request related to a problem? Please describe.

Publishing formulas to a Homebrew tap requires a Personal Access Token.

However publishing to an AUR repo requires an SSH key.

$ export GITHUB_TOKEN="<token that has access to both my BREW-TAP and AUR repos>"
$ goreleaser release
  ...
    • homebrew tap formula
      • pushing                                      repository=bartekpacia/homebrew-tools branch= file=Formula/fhome.rb
      • pushing                                      repository=bartekpacia/homebrew-tools branch= file=Formula/fhomed.rb
      • took: 3s
    • arch user repositories
      • pipe skipped                                 reason=private_key is empty
  ...

Describe the solution you'd like

I'd like to not be forced to provide SSH key that can access my AUR repo. Instead I'd like to be able to use a Personal Access Token, just like with Homebrew taps.

If it's not possible, as a user I'd like to know what's the cause of this.

Describe alternatives you've considered

Search

  • I did search for other open and closed issues before opening this

Supporter

Code of Conduct

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

Additional context

huge thanks for creating and maintaining this tool!

@bartekpacia bartekpacia added enhancement New feature or request triage Issue pending triage by one of the maintainers labels Mar 29, 2024
@caarlos0
Copy link
Member

It's because the AUR pipe pushes to https://aur.archlinux.org only, and the only way of auth there is private keys.

FWIW you can create another private key just for your account there.


huge thanks for creating and maintaining this tool!

thank you! 🙏

@caarlos0 caarlos0 added question Further information is requested and removed enhancement New feature or request triage Issue pending triage by one of the maintainers labels Mar 29, 2024
@caarlos0 caarlos0 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2024
@bartekpacia
Copy link
Contributor Author

bartekpacia commented Mar 29, 2024

It's because the AUR pipe pushes to https://aur.archlinux.org/ only, and the only way of auth there is private keys.

Ah yeah, this makes sense. Thank you. But I am using aurs in my GoReleaser to push to my private AUR repo. See here. Is this the valid usecase?

I do not plan on pushing to "official" AUR.

@caarlos0
Copy link
Member

I think you could set the git_url to the the one of that repo, but yeah, it will not be as "clean" as brews for example 🤔

@bartekpacia
Copy link
Contributor Author

you could set the git_url to the the one of that repo

Sorry, I don't think I understand. Do you mean this?

"In the .goreleaser.yaml file in the bartekpacia/fhome repository, set git_url to git@github.com:bartekpacia/fhome.git? So in other words, eliminate bartekpacia/aur repository"?

@caarlos0
Copy link
Member

caarlos0 commented Apr 3, 2024

I mean, you could do something like this:

aurs:
  - # ...
    git_url: "git@github.com:bartekpacia/aur.git"
    # ...

@bartekpacia
Copy link
Contributor Author

bartekpacia commented Apr 3, 2024

I'm already doing this: https://github.com/bartekpacia/fhome/blob/40d11f11f2393cfc7139f2669ab36d8c4db819de/.goreleaser.yaml#L100. It requires me to specify an SSH key in private_key.

I mean, if in brews I can specify repo A to push to using a PAT, I'd also like to be able, in aurs, to specify repo B and push to it using a PAT as well.

@caarlos0
Copy link
Member

caarlos0 commented Apr 3, 2024

yes, pat would not work, you'll need to set a private key as well

Thinking more about it now, I think you might be able to workaround it with

aur:
  - # ...
    # set a https url authing with the PAT
    git_url: "https://{{ .Env.GH_PATH }}@github.com/bartekpacia/aur"

    # path to a key generated at runtime, would not be used
    private_key: ./foo

    # by default this will use the private_key value, override so it doesn't
    git_ssh_command: "ssh"
    # ...

PS: i havent tested this, but I think it might work

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

No branches or pull requests

2 participants