PyGithub / PyGithub/PyGithub

repo.get_contents( ) with tag/release parameter

Open
#2,252 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.8k
Forks
1.9k
Avg merge
17m
Merged PRs (30d)
2

Description

I'm not sure if there is an existing solution and I can't find it, but I would like to load files from an old version of a particular repo. Currently I can only load the latest version of the file from master. So another parameter in repo.get_contents( ) for a version tag would be great.

For example, I would like to load the license file of version v1.53 (https://github.com/PyGithub/PyGithub/blob/v1.53/COPYING) instead of the one from the master (https://github.com/PyGithub/PyGithub/blob/master/COPYING).
repo.get_contents(path="COPYING", tag="v1.53")

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the repo.get_contents implementation and inspect how it builds the GitHub contents request. Verify the version selector against the provided v1.53 COPYING example; done means an old tagged file can be loaded without changing latest-file behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.