Skip to content

Commit 0f62439

Browse files
committed
add try-catch for get-pr
1 parent ac63a2c commit 0f62439

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/check-sample.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ jobs:
7070
repo: context.repo.repo,
7171
pull_number: pr_number
7272
});
73+
} catch (getPrError) {
74+
throw new Error ("Could not get current PR from source. Please fix the issues and try again.")
75+
}
7376
77+
try {
7478
let newBody;
7579
const body = pullRequest.body || "";
7680
const markerIndex = body.indexOf(marker);
@@ -97,7 +101,6 @@ jobs:
97101
if (error) {
98102
throw new Error("Incomplete samples checklist. Please fix the issues and try again.");
99103
}
100-
101104
102105
- name: Create / Update Template Repo
103106
uses: actions/github-script@v7

0 commit comments

Comments
 (0)