Skip to content

Commit

Permalink
Removed GitHub PAT code from Catapult
Browse files Browse the repository at this point in the history
  • Loading branch information
Inglonias committed Dec 21, 2021
1 parent 52f56b1 commit 08d560f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
5 changes: 1 addition & 4 deletions scripts/ChangelogDialod.gd
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ func download_pull_requests():
var url = _PR_URL[_settings.read("game")]
url += "+is%3Apr+is%3Amerged&per_page=" + prs
var headers = ["user-agent: CatapultGodotApp"]
var pat = _settings.read("github_pat")
if (pat.length() == 40):
headers.push_back("Authorization: token " + pat)
_pr_data = "Fetching recent changes from GitHub. Please wait..."
_pullRequests.request(url, headers)
_changelogTextBox.clear()
Expand All @@ -46,7 +43,7 @@ func _on_PullRequests_request_completed(result, response_code, headers, body):
_pr_data += "\n\nHTTP response code: " + str(response_code)
if (json) and ("message" in json):
_pr_data += "\nGitHub says: [i]%s[/i]" % json["message"]
_pr_data += "\n\nSometimes, requests will fail repeatedly due to excessive load on the server, especially for DDA. This may depend on the time of day, your location, etc. There's little anyone can do about this. If you are registered on GitHub, you can add your [url=https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token]PAT (Personal Access Token)[/url] to Catapult config file to increase the priority of your requests or bypass rate limits."
_pr_data += "\n\nPlease try again later."
else:
_pr_data = process_pr_data(json)
_changelogTextBox.clear()
Expand Down
5 changes: 0 additions & 5 deletions scripts/SettingsUI.gd
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,3 @@ func _on_any_migration_checkbox_toggled(_asdf: bool) -> void:
data_types.append(type)

_settings.store("game_data_to_migrate", data_types)


func _on_lePATUse_text_changed(new_text):
if (new_text.length() == 40 or new_text.length() == 0):
_settings.store("github_pat", new_text)
1 change: 0 additions & 1 deletion scripts/settings_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const _HARDCODED_DEFAULTS = {
"shorten_release_names": false,
"num_releases_to_request": 10,
"num_prs_to_request": 50,
"github_pat": "",
"ui_scale_override": 1.0,
"ui_scale_override_enabled": false,
"show_stock_mods": false,
Expand Down

0 comments on commit 08d560f

Please sign in to comment.