diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 82b8171..ff25a6d 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -16,21 +16,26 @@ jobs: const parentIssue = context.issue; const parentIssueTitle = context.payload.issue.title; const parentIssueNumber = parentIssue.number; + const repo = parentIssue.repo; + const owner = parentIssue.owner; // Create the sub-issue const newIssue = await github.rest.issues.create({ - owner: parentIssue.owner, - repo: parentIssue.repo, + owner: owner, + repo: repo, title: `Backport #" + parentIssueNumber + " to release/v0`, body: `"Backport #" + parentIssueNumber + " to release/v0` }); const subIssueId = newIssue.data.id; - // Attach the sub-issue to the parent - await github.rest.issues.addSubIssue({ - owner: parentIssue.owner, - repo: parentIssue.repo, + // Attach the sub-issue to the parent using API request + await github.request('POST /repos/{owner}/{repo}/issues/{parentIssueNumber}/sub_issues', { + owner: owner, + repo: repo, issue_number: parentIssueNumber, - sub_issue_id: subIssueId + sub_issue_id: subIssueId, + headers: { + 'X-GitHub-Api-Version': '2022-11-28' + } });