Unhelpful errors on syntax issues
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- github-actions, javascript, typescript
- Lĩnh vực
- ci-cd, developer-experience, tooling
Hướng nghiên cứu
Start from the script execution path represented by callAsyncFunction and main in the reported dist/index.js stack, and trace how syntax errors from the action code are surfaced. Done means syntax errors identify the relevant line in the supplied script, ideally including the source line, with tests covering the improved output.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
Currently problems with action code can cause errors like this:
SyntaxError: Unexpected token '.'
at new AsyncFunction (<anonymous>)
at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:[35](https://github.com/dktapps/RestrictedActions/actions/runs/11989435916/job/33425884775#step:4:36)424:16)
at main (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35522:26)
at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35497:1
at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35553:3
at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35556:12)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
I haven't the faintest clue where or why this happened with my code. Plugging it into a linter didn't reveal any problems.
It would be nice if the error output included a line number in the actual action code to show where the problem occurred, or even better printed the line in question.
Here's the code this happened with, if it's relevant:
- name: "Check if bot's review was dismissed (pull_request_review.dismissed only)"
id: re-review
uses: actions/github-script@v7
env:
APP_SLUG: ${{ steps.generate-token.outputs.app-slug }}
REVIEWER_ID: ${{ github.event.client_payload.reviewer_id }}
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const reviewer_id = process.env.REVIEWER_ID;
console.log(reviewer_id);
if (reviewer_id === "0") {
console.log("No reviewer ID provided, continuing with re-review");
core.setOutput('skip', 'false');
} else {
console.log("Reviewer ID provided: " + reviewer_id);
const user_info = await github.rest.users.getByUsername({
process.env.APP_SLUG + '[bot]'
});
const bot_user_id = user_info.data.id;
if (bot_user_id != reviewer_id) {
console.log(`Not the bot's review that was dismissed (expected user ID: ${bot_user_id}, got: ${reviewer_id})`);
console.log('Skipping re-review');
core.setOutput('skip', 'true');
} else {
console.log("Bot's review was dismissed, continuing with re-review");
core.setOutput('skip', 'false');
}
}
Describe the solution you'd like
It would be nice if the error output included a line number in the actual action code to show where the problem occurred, or even better printed the line in question.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
- 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của actions/github-script
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
actions/github-script#728 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
actions/github-script#727 · 1 reaction ·
-
{ Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
actions/github-script#724 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
actions/github-script#723 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
actions/github-script#714 · 1 bình luận · 4 reaction ·
Tất cả issue của actions/github-script
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/inspector#2458 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
carbon-design-system/ibm-products#9907 ·