Skip to content

Unable to get from private repo (within a GitHub team) #445

Description

@amitkparekh

Your bug may already be reported!
Please search on the issue tracker before creating one.
If you found an issue, write a comment or upvote it with a thumbs-up 👍🏻.

Expected behavior

I should be able to get the style from a private repo within a GitHub team.

Current behavior

Currently getting a 404 error with URL not found.

Steps to reproduce

  1. Put a nitpick style in a private repo
  2. Create a PAT with the repos scope
  3. Add github://$GITHUB_PAT@team-name/repo-name/nitpick-style.toml to a pyproject.toml in another project ($GITHUB_PAT is the GitHub Personal Access Token, which can either be copy-pasted or as a env variable, as described in the documentation).
  4. Run nitpick check
  5. Get 404.

Possible Solution

I looked at the fetcher for GitHub URLs and I noticed that there isn't an aspect which also specifies the username. I tried to use curl as shown by the GitHub API docs and was able to get to the correct repo and file because I provided both my username and the PAT in -u.

Context

We have a common template repository with rules and such for GitHub Actions and a common style guide, but any changes to it need to be manually updated to all derived repositories. Nitpick reminds me of ESLint configs (like AirBnB's) where there can be a single source that projects can pull from, and any changes can be reflected throughout.

Your environment

  • nitpick version used: 0.31.0

  • Python version: 3.9.9

  • Operating System and version: Mac OS 12.0.1

  • Link to your project:

  • Run the following commands and paste the output:

    which python3
    python3 -V
    pip freeze
    cat $(which flake8)

For more information, see the CONTRIBUTING guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requestedstyleAnything related to Nitpick style files

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions