Skip to content

Commit

Permalink
Merge pull request #53 from piotrnarajowski/fetch_head
Browse files Browse the repository at this point in the history
add fetch_head to git diff
  • Loading branch information
piotrnarajowski authored Jul 22, 2024
2 parents e1e4476 + 3b4021a commit 7a52cd7
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions .github/check_for_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,16 @@ def main():
return

try:
pr = os.environ.get('PR_NUMBER')
string = f"refs/pull/{pr}/merge"
print(os.environ)
pr_number = os.environ.get('PR_NUMBER')
fetch_str = f"refs/pull/{pr_number}/merge"
fetch = subprocess.run(
['git', 'fetch', 'origin', string],
['git', 'fetch', 'origin', fetch_str],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=True
)

print(f"git fetch origin refs/pull/: {fetch}")

commit = os.environ.get('FETCH_HEAD')

# mb = run_cmd(f"git merge-base {upstream} {commit}")
# upstream = mb[0]
#
print(f"fetch head: {commit}")

result = subprocess.run(
['git', 'diff', '--name-only', 'HEAD', commit, '--', 'autopts/wid/'],
['git', 'diff', '--name-only', 'HEAD', 'FETCH_HEAD', '--', 'autopts/wid/'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=True
)

Expand Down

0 comments on commit 7a52cd7

Please sign in to comment.