diff --git a/scripts/ci/pre_commit/update_installers_and_pre_commit.py b/scripts/ci/pre_commit/update_installers_and_pre_commit.py index eed555e93fe40..70054b6d5508c 100755 --- a/scripts/ci/pre_commit/update_installers_and_pre_commit.py +++ b/scripts/ci/pre_commit/update_installers_and_pre_commit.py @@ -249,6 +249,16 @@ def replacer(match): if __name__ == "__main__": + if not GITHUB_TOKEN: + console.print( + "[red]GITHUB_TOKEN environment variable is not set. This will lead to failures on rate limits.[/]\n" + "Please set it to a valid GitHub token with public_repo scope. You can create one by clicking " + "the URL:\n\n" + "https://github.com/settings/tokens/new?scopes=public_repo&description=airflow-update-installers-and-pre-commit\n\n" + "Once you have the token you can prepend pre-commit command with GITHUB_TOKEN='' or" + "set it in your environment with export GITHUB_TOKEN=''\n\n" + ) + sys.exit(1) changed = False golang_version = get_latest_golang_version() pip_version = get_latest_pypi_version("pip")