Skip to content

Commit e87f833

Browse files
committed
changes
1 parent 5f000c7 commit e87f833

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/codelab-watchdog.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened, synchronize, reopened, edited]
66
paths:
77
- '**/SourceDbToSpannerOptions.java'
8-
- '**/DatastreamToSpanner.java'
8+
- '**/DataStreamToSpanner.java'
99
- '**/SpannerToSourceDb.java'
1010

1111
jobs:
@@ -27,9 +27,9 @@ jobs:
2727
echo "Checking PR diff for template parameter changes..."
2828
gh pr diff "$PR_NUMBER" --repo "$REPO" > pr_diff.txt
2929
30-
# Check if the diff modifies lines containing common parameter annotations or getters
30+
# Check if added (+) or removed (-) lines contain the parameter annotations
3131
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
3333
HAS_PARAM_CHANGES=true
3434
fi
3535
@@ -42,7 +42,7 @@ jobs:
4242
MARKER="<!-- codelab-watchdog-comment -->"
4343
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)
4444
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
4646
echo "✅ Found CODELAB_BUG tag in PR description. Workflow unblocked."
4747
4848
# If we previously left a warning comment, gracefully update it to green.
@@ -52,7 +52,7 @@ jobs:
5252
echo "A \`CODELAB_BUG\` reference was found. Thank you for tracking the DevSite Codelab documentation updates!" >> comment.md
5353
echo "" >> comment.md
5454
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
5656
fi
5757
exit 0
5858
fi
@@ -72,10 +72,10 @@ jobs:
7272
# We PATCH (update) the existing comment to avoid spamming the PR with duplicate comments.
7373
# If it is empty, we use 'gh pr comment' to create a brand new comment.
7474
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
7676
else
77-
gh pr comment "$PR_NUMBER" --body-file comment.md --repo "$REPO"
77+
gh pr comment "$PR_NUMBER" --body-file comment.md --repo "$REPO" || true
7878
fi
7979
80-
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."
8181
exit 1

0 commit comments

Comments
 (0)