@@ -38,28 +38,36 @@ jobs:
3838 })
3939 linkedPRs = linkedPRs["data"];
4040 console.log(linkedPRs);
41- if (linkedPRs.length > 0) {
42- console.log("Found linked PR");
43- linkedPR = linkedPRs[0]
44- isDeprecation = false
45- for (label of linkedPR["labels"]) {
46- if (label["name"] == "Deprecate") {
47- isDeprecation = true;
48- break;
41+ try {
42+ if (linkedPRs.length > 0) {
43+ console.log("Found linked PR");
44+ linkedPR = linkedPRs[0]
45+ isDeprecation = false
46+ for (label of linkedPR["labels"]) {
47+ if (label["name"] == "Deprecate") {
48+ isDeprecation = true;
49+ break;
50+ }
4951 }
50- }
5152
52- PR_NUMBER = linkedPR["number"];
53+ PR_NUMBER = linkedPR["number"];
5354
54- body += ("\n- [ ] #" + PR_NUMBER);
55- if (isDeprecation) {
56- console.log("PR is a deprecation PR. Printing new body of issue");
57- console.log(body);
58- github.rest.issues.update({
59- owner: context.repo.owner,
60- repo: context.repo.repo,
61- issue_number: ${{ env.DEPRECATION_TRACKER_ISSUE }},
62- body: body
63- })
55+ body += ("\n- [ ] #" + PR_NUMBER);
56+ if (isDeprecation) {
57+ console.log("PR is a deprecation PR. Printing new body of issue");
58+ console.log(body);
59+ github.rest.issues.update({
60+ owner: context.repo.owner,
61+ repo: context.repo.repo,
62+ issue_number: ${{ env.DEPRECATION_TRACKER_ISSUE }},
63+ body: body
64+ })
65+ }
66+ }
67+ } catch (error) {
68+ if (error.status === 404) {
69+ core.warning('Resource not found. Please check issue/repo references.');
70+ } else {
71+ throw error;
6472 }
6573 }
0 commit comments