Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 4 additions & 5 deletions .github/workflows/pr-governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ jobs:
).stdout
old_shas, new_shas = [], []
for line in raw.splitlines():
parts = line.split("\t")[0].split()
meta, _path = line.split("\t", 1)
# git diff --raw header: :oldmode newmode oldsha newsha status
cols = meta.split()
# mode 160000 marks a gitlink change; columns: src dst mode status
if len(cols) >= 5 and cols[2] == "160000":
old_shas.append(cols[3].lstrip(":"))
new_shas.append(cols[4])
if len(cols) >= 5 and cols[1] == "160000":
old_shas.append(cols[2])
new_shas.append(cols[3])
context = {
"target_branch": os.environ.get("TARGET_BRANCH", ""),
"labels": [x.strip() for x in os.environ.get("PR_LABELS", "").split(",") if x.strip()],
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/submodule-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:
echo "changed<<EOF" >> "$GITHUB_OUTPUT"
echo "$CHANGED" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
GITLINKS=$(git diff --raw "$BASE_SHA..$HEAD_SHA" | awk '$4 ~ /160000/' | wc -l | tr -d ' ')
# git diff --raw header is ":oldmode newmode oldsha newsha status";
# gitlinks are marked by mode 160000, which awk sees as $1/$2.
GITLINKS=$(git diff --raw "$BASE_SHA..$HEAD_SHA" | awk '$2 == "160000"' | wc -l | tr -d ' ')
echo "count=$GITLINKS" >> "$GITHUB_OUTPUT"

- name: Full submodule validation
Expand Down
Loading