DeterminateSystems / nix-installer-action

The Github Action for the Determinate Nix Installer
https://github.com/determinateSystems/nix-installer
GNU Lesser General Public License v2.1
169 stars 16 forks source link

Proposal: default github-token to github.token #3

Closed EricCrosson closed 1 year ago

EricCrosson commented 1 year ago

Howdy,

Thanks for your work on nix-installer and this action! I'm rooting for the success of both projects :slightly_smiling_face:

I noticed the readme recommends supplying the github-token input, otherwise "you will likely get rate limited."

Have you considered defaulting github-token to the github.token value from the github context? This would improve the ergonomics of using the action:

    - name: Install Nix
      uses: DeterminateSystems/nix-installer-action@main

though it would change the semantics of the current implementation. I'm not sure how strongly the maintainers feel about keeping the current behavior, which makes it possible to avoid authenticated requests.

Though, one option would be to explicitly opt out of authenticated requests, maybe with an input like:

    - name: Install Nix
      uses: DeterminateSystems/nix-installer-action@main
      with:
        github-token: ""

or

    - name: Install Nix
      uses: DeterminateSystems/nix-installer-action@main
      with:
        use-unauthenticated-requests: true

What do you think? I'm happy to open a PR if this aligns with the direction of the project.

Cheers!

Hoverbear commented 1 year ago

Hmm I tried defaulting it to ${{ secrets.GITHUB_TOKEN }} however that didn't work. We can give it a shot with ${{ github.token }}!

This behavior is desired I think!

If you wanted to do this PR please go ahead! You can make a PR change against https://github.com/DeterminateSystems/nix-installer-example to test. :)

EricCrosson commented 1 year ago

Sounds like a plan!

I created https://github.com/DeterminateSystems/nix-installer-action/pull/6 with the changes and https://github.com/DeterminateSystems/nix-installer-example/pull/5 to test them :crossed_fingers: