You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Check if the diff modifies lines containing common parameter annotations or getters
30
+
# Check if added (+) or removed (-) lines contain the parameter annotations
31
31
HAS_PARAM_CHANGES=false
32
-
if grep -E -iq 'TemplateParameter|description|helpText|Validation\.Required' pr_diff.txt; then
32
+
if grep -E '^[+-].*(TemplateParameter|description|helpText|Validation\.Required)' pr_diff.txt | grep -v '^[+-]\{3\}' > /dev/null; then
33
33
HAS_PARAM_CHANGES=true
34
34
fi
35
35
@@ -42,7 +42,7 @@ jobs:
42
42
MARKER="<!-- codelab-watchdog-comment -->"
43
43
COMMENT_URL=$(gh api "repos/$REPO/issues/$PR_NUMBER/comments" -q ".[] | select(.user.login == \"github-actions[bot]\" and (.body | contains(\"$MARKER\"))) | .url" | head -n 1)
44
44
45
-
if echo "$PR_BODY" | grep -E -q 'CODELAB_BUG=b/[0-9]+'; then
45
+
if printf "%s\n" "$PR_BODY" | grep -E -q 'CODELAB_BUG=b/[0-9]+'; then
46
46
echo "✅ Found CODELAB_BUG tag in PR description. Workflow unblocked."
47
47
48
48
# If we previously left a warning comment, gracefully update it to green.
@@ -52,7 +52,7 @@ jobs:
52
52
echo "A \`CODELAB_BUG\` reference was found. Thank you for tracking the DevSite Codelab documentation updates!" >> comment.md
53
53
echo "" >> comment.md
54
54
echo "Please follow the step-by-step instructions in [go/update-migrations-codelabs](http://go/update-migrations-codelabs) to update the codelabs with your changes." >> comment.md
55
-
gh api -X PATCH "$COMMENT_URL" -F body=@comment.md
55
+
gh api -X PATCH "$COMMENT_URL" -F body=@comment.md || true
56
56
fi
57
57
exit 0
58
58
fi
@@ -72,10 +72,10 @@ jobs:
72
72
# We PATCH (update) the existing comment to avoid spamming the PR with duplicate comments.
73
73
# If it is empty, we use 'gh pr comment' to create a brand new comment.
74
74
if [ -n "$COMMENT_URL" ]; then
75
-
gh api -X PATCH "$COMMENT_URL" -F body=@comment.md
75
+
gh api -X PATCH "$COMMENT_URL" -F body=@comment.md || true
echo "::error::Missing CODELAB_BUG=b/XXXX in PR description."
80
+
echo "::error title=Codelab Update Required::This PR modifies pipeline parameters. To unblock this PR, add a bug tracker reference to the PR description (e.g., CODELAB_BUG=b/123456). Follow instructions in go/update-migrations-codelabs to update the documentation."
0 commit comments