AddSubIssue functions missing

Đang mở
#519 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
github, typescript
Lĩnh vực
api, devtools

Hướng nghiên cứu

Start by checking how this repository exposes the Octokit REST client and which Octokit version it uses; the report shows that issues.addSubIssue is missing while the latest release documents it. Reproduce the GitHub Actions script from the issue, then verify that the sub-issue call is available and creates the expected link.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

dependencies

Describe the bug
github.rest.issues.addSubIssue is not a function, octokit has the function in the latest release

To Reproduce
Run a github action to create a sub issue:

      - name: Create linked sub-issues from tasklist
        uses: actions/github-script@v7.0.1
        with:
          script: |
            const issueBody = context.payload.issue.body
            const parentIssueNumber = context.payload.issue.number

            // Extract the content between ```[tasklist] and ```
            const matchTasklist = issueBody.match(/```\[tasklist\]([\s\S]*?)```/)
            if (!matchTasklist) {
              core.info('No [tasklist] section found in the issue body.')
              return
            }

            const tasklistContent = matchTasklist[1]
            // Identify lines that match '- [ ] ...'
            const tasks = tasklistContent.match(/^- \[ \] .+/gm) || []

            for (const task of tasks) {
              const title = task.replace(/^- \[ \] /, '').trim()
              const newIssue = await github.rest.issues.create({
                owner: context.repo.owner,
                repo: context.repo.repo,
                title: title,
                body: `Sub-issue of #${parentIssueNumber}`
              })

              // Link the sub issue to the parent issue
              await github.rest.issues.addSubIssue({
                owner: context.repo.owner,
                repo: context.repo.repo,
                issue_number: parentIssueNumber,
                sub_issue_id: newIssue.data.id
              })

               // Comment on the parent issue linking the new sub-issue
              await github.rest.issues.createComment({
                owner: context.repo.owner,
                repo: context.repo.repo,
                issue_number: parentIssueNumber,
                body: `Created sub-issue: #${newIssue.data.number} for task: "${title}"`
              })             
            }

Expected behavior
A sub issue should be created based on the inputs

Screenshots

Error

Additional context
Trying to create sub issues based off an issue template and hitting this error

Ngôn ngữ chính
TypeScript
Star
5k
Fork
586
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của actions/github-script

Tất cả issue của actions/github-script

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.