Skip to content

Commit e952b7c

Browse files
authored
chore(.github): fix apidiff detection of GA breaking changes (googleapis#14134)
Scan apidiff output for GA package paths (e.g., apiv1/) to ensure breaking changes in GA packages nested within a non-versioned module (like 'shopping') correctly fail the build. fixes: googleapis#13314
1 parent dfb0453 commit e952b7c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/apidiff.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ jobs:
117117
id: ga_check # Add an ID to this step to check its outcome later.
118118
if: steps.detect.outputs.breaking_change_found == 'true'
119119
run: |
120-
if [[ "${MATRIX_CHANGED}" =~ apiv[0-9]+$ ]]; then
120+
# Fail if the module path itself indicates that it is GA (e.g. "compute/apiv1").
121+
# Some modules (e.g. "shopping") contain multiple API versions below the module root.
122+
# For these, we also check diff.txt for GA package paths (e.g. apiv1/) to
123+
# catch breaking changes in GA packages nested within a non-versioned module.
124+
if [[ "${MATRIX_CHANGED}" =~ apiv[0-9]+$ ]] || grep -q -E "(/|^)apiv[0-9]+(/|:)" "${MATRIX_CHANGED}/diff.txt"; then
121125
echo "Error: Breaking change detected in GA API: ${MATRIX_CHANGED}"
122126
exit 1
123127
fi

0 commit comments

Comments
 (0)