Skip to content

Commit eaeed2a

Browse files
committed
chore(IDX): make sure correct branch is checked out
1 parent 28a8a28 commit eaeed2a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/repo_policies.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
uses: actions/checkout@v4
2323
with:
2424
path: current-repo # need to specify another path to avoid overwriting the first checkout
25+
ref: ${{ github.head_ref }}
2526

2627
- name: Python Setup
2728
uses: ./public-workflows/.github/workflows/python-setup
@@ -40,6 +41,7 @@ jobs:
4041
GH_ORG: ${{ github.repository_owner }}
4142
USER: ${{ github.event.pull_request.user.login }}
4243
REPO: ${{ github.event.repository.name }}
44+
BRANCH: ${{ github.event.pull_request.head.ref }}
4345
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
4446
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
4547
REPO_PATH: current-repo

reusable_workflows/repo_policies/bot_checks/check_bot_approved_files.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ def get_changed_files(merge_base_sha: str, branch_head_sha: str, repo_path: Opti
2323
Compares the files changed in the current branch to the merge base.
2424
"""
2525
commit_range = f"{merge_base_sha}..{branch_head_sha}"
26+
# debug
27+
current_branch = subprocess.run(["git", "branch"], capture_output=True, cwd=repo_path)
28+
print(f"current branch: {current_branch.stdout}"
29+
)
2630
result = subprocess.run(
2731
["git", "diff", "--name-only", commit_range],
2832
capture_output=True,

0 commit comments

Comments
 (0)