Skip to content

Commit

Permalink
Lab script fetch track fork (#296)
Browse files Browse the repository at this point in the history
* git fetch origin

* Add track origin main step
  • Loading branch information
cedricvidal authored Dec 13, 2024
1 parent 96a292e commit be4a20f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/workshop/lab_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ def fork_repository():
out, err = process.communicate()
print(out)

@step("Fetch Origin")
def fetch_origin():
"""
Fetch the latest changes from origin.
Necessary because after forking repository, origin has not been fetched.
"""
subprocess.run(['git', 'fetch', 'origin'], check=True)

@step("Track origin/main")
def track_origin_main():
"""
Set the main branch to track origin/main instead of upstream/main
Necessary because after forking repository, main is still tracking upstream.
"""
subprocess.run(['git', 'branch', 'main', '--set-upstream-to', 'origin/main'], check=True)

@step("Azure CLI Authentication")
def azure_login(*, username: str = None, password: str = None, tenant: str = None, force: bool = False):
# Only check authentication status if not forcing re-auth
Expand Down

0 comments on commit be4a20f

Please sign in to comment.