Skip to content

Commit

Permalink
chore(IDX): make sure correct branch is checked out
Browse files Browse the repository at this point in the history
  • Loading branch information
cgundy committed Dec 9, 2024
1 parent 28a8a28 commit eaeed2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/repo_policies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: actions/checkout@v4
with:
path: current-repo # need to specify another path to avoid overwriting the first checkout
ref: ${{ github.head_ref }}

- name: Python Setup
uses: ./public-workflows/.github/workflows/python-setup
Expand All @@ -40,6 +41,7 @@ jobs:
GH_ORG: ${{ github.repository_owner }}
USER: ${{ github.event.pull_request.user.login }}
REPO: ${{ github.event.repository.name }}
BRANCH: ${{ github.event.pull_request.head.ref }}
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
REPO_PATH: current-repo
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def get_changed_files(merge_base_sha: str, branch_head_sha: str, repo_path: Opti
Compares the files changed in the current branch to the merge base.
"""
commit_range = f"{merge_base_sha}..{branch_head_sha}"
# debug
current_branch = subprocess.run(["git", "branch"], capture_output=True, cwd=repo_path)
print(f"current branch: {current_branch.stdout}"
)
result = subprocess.run(
["git", "diff", "--name-only", commit_range],
capture_output=True,
Expand Down

0 comments on commit eaeed2a

Please sign in to comment.