Skip to content

Not using "token" on github server #229

Description

@ecs-jnguyen

Describe the bug

Hi I am using actions/setup-python on a private github server. When I run curl https://github.com/@api/rate_limit in the self-hosted runner I have 60 remaining resources. When I run the curl command again after uses: actions/setup-python I see that the resource counter goes down to 58. Since I am running this action a lot I eventually exceed my api call limit.

I tried using the key token under the with section with a token I created from github cloud but that did not work. I saw that when we are running on github server we are setting the AUTH variable to undefined. Link to code.

I know we are using ${{ github.token }} by default from the actions.yml file. So I believe the check for github server was added so that tokens from the private github server don't get sent to github cloud. Could we add a second input for the token so that people running on private github servers don't run into the api call limit error? Or if we detect that we are running on a private github server, could we try to use actions/python-versions on the github server instead?

Which version of the action are you using?

  • v1
  • v2
  • Some other tag (such as v2.0.1 or master)

Environment

  • [ x ] self-hosted
  • Linux
  • Windows
  • Mac

If applicable, please specify if you're using a container

Python Versions

  • 3.8
  • 3.9

To Reproduce
Steps to reproduce the behavior:

  1. Run github actions with actions/setup-python@v2 on github server a lot
  2. Then we run into Error: API rate limit exceeded for <IP address>. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

github actions yaml file:

name: CI

on:
  push:
    branches: [ master ]

jobs:
  sample_build:
    runs-on: [ self-hosted ]
    steps:
      - name: "rate limit"
        run: |
          curl -H "Accept: application/vnd.github.v3+json" https://github.com/@api/rate_limit

      - name: Set up Python 3.9
        uses: actions/setup-python@v2
        with:
          token: ${{ secrets.GH_CLOUD_TOKEN }}
          python-version: 3.9

      - name: "rate limit"
        run: |
          curl -H "Accept: application/vnd.github.v3+json" https://github.com/@api/rate_limit

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions