Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with fetching last commit #14

Open
NoahTheDuke opened this issue Nov 2, 2020 · 0 comments
Open

Issue with fetching last commit #14

NoahTheDuke opened this issue Nov 2, 2020 · 0 comments

Comments

@NoahTheDuke
Copy link

Seems that the params={'sha': 'main'}, line can make fetching the commits not work.

Current behavior

$ changelog mtgred netrunner
Traceback (most recent call last):
  File "/Users/noah/.pyenv/versions/3.7.5/bin/changelog", line 8, in <module>
    sys.exit(main())
  File "/Users/noah/.pyenv/versions/3.7.5/lib/python3.7/site-packages/changelog/__init__.py", line 232, in main
    changelog = generate_changelog(**vars(args))
  File "/Users/noah/.pyenv/versions/3.7.5/lib/python3.7/site-packages/changelog/__init__.py", line 195, in generate_changelog
    prs = fetch_changes(github_config, owner, repo, previous_tag, current_tag)
  File "/Users/noah/.pyenv/versions/3.7.5/lib/python3.7/site-packages/changelog/__init__.py", line 155, in fetch_changes
    current_commit = get_last_commit(github_config, owner, repo, branch)
  File "/Users/noah/.pyenv/versions/3.7.5/lib/python3.7/site-packages/changelog/__init__.py", line 84, in get_last_commit
    commits_json['message']))
changelog.GitHubError: Unable to get commits. Not Found

Expected behavior

$ changelog mtgred netrunner
- Noise milling fix #5348
[other commits here as well]

Steps to replicate behavior (include URLs)

The only thing I changed to get this working is line 79 of init.py:

    commits_response = requests.get(commits_url, #params={'sha': 'main'},
                                    headers=github_config.headers)

I don't know enough to know why this works, just that it does.

Thanks so much.

stevejalim added a commit to uktrade/github-changelog that referenced this issue Mar 10, 2021
Experienced the same issue as cfpb#14 so trying out the fix -- seems to work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant