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

Closed
opened 2023-01-21 19:21:34 +00:00 by EricCrosson · 2 comments
EricCrosson commented 2023-01-21 19:21:34 +00:00 (Migrated from github.com)

Howdy,

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

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!

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: ```yaml - 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: ```yaml - name: Install Nix uses: DeterminateSystems/nix-installer-action@main with: github-token: "" ``` or ```yaml - 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! [github context]: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
Hoverbear commented 2023-01-30 22:25:01 +00:00 (Migrated from github.com)

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. :)

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 2023-01-31 01:10:47 +00:00 (Migrated from github.com)
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:
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix-install-action#3
No description provided.