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

Remove test to confirm that the GitHub token is authorized to push #199

Merged
merged 2 commits into from
Nov 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove test to confirm that the GitHub token is authorized to push
  • Loading branch information
dbeatty10 committed Nov 4, 2022
commit 188b4d0c4593bad35e815496d00b745b80843bf4
27 changes: 0 additions & 27 deletions hubcap/hubcap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import logging
import git_helper
import os
import subprocess

from pathlib import Path

Expand Down Expand Up @@ -74,30 +71,6 @@
update_tasks, hub_dir_path, pr_strategy, default_branch=default_branch
)

# =
# = Add a branch with no commits to confirm that pushing works correctly
# =

branch_name = f"bump-test-{helper.NOW}"

main_dir = Path(TMP_DIR) / github_repo
os.chdir(main_dir)
completed_subprocess = subprocess.run(["git", "checkout", "-q", "-b", branch_name])
if completed_subprocess.returncode == 128:
git_helper.run_cmd(f"git checkout -q {branch_name}")

# Commit an empty file
with open(branch_name, "w") as fp:
pass
git_helper.run_cmd("git add -A")
subprocess.run(args=["git", "commit", "-am", "Test commit"], capture_output=True)

# Reset back to the default branch
git_helper.run_cmd(f"git checkout -q {default_branch}")

# Add this branch to the list
new_branches[branch_name] = {"org": "dbt-labs", "repo": "hub.getdbt.com"}

# =
# = push new branches, if there are any
# =
Expand Down