Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[workshop-sync] side-quest-13-01-pr-labeler-pattern.md: invalid add-labels schema and disallowed write permission

Đã đóng Phù hợp với người mới
#4,045 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
92/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, markdown, yaml
Lĩnh vực
documentation

Hướng nghiên cứu

Mở workshop/side-quest-13-01-pr-labeler-pattern.md và kiểm tra frontmatter mẫu trong .github/workflows/pr-labeler.md. Thay thế trường add-labels không hợp lệ và xóa quyền ghi không được phép như mô tả, sau đó chạy gh aw compile --validate ở strict mode. Hoàn tất khi ví dụ được biên dịch mà không có lỗi hoặc cảnh báo.

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

Mô tả

documentation

Workshop file reviewed

workshop/side-quest-13-01-pr-labeler-pattern.md

Problem

The example workflow frontmatter in this file fails to compile with the current gh-aw CLI (v0.89.21) for two reasons:

  1. Invalid add-labels field limit:

    safe-outputs:
      add-labels:
        limit: 5
    

    Compiling this with gh aw compile --validate produces:

    error: Unknown property: limit. Valid fields are: allowed, allowed-repos, blocked, create-if-missing, github-app, github-token, issue-intent, issues, max, pull-requests, ...
    
  2. Disallowed write permission alongside safe-outputs:

    permissions:
      pull-requests: write
      contents: read
    

    Compiling in strict mode (the workshop's default/recommended mode) produces:

    error: strict mode: write permission 'pull-requests: write' is not allowed for security reasons. Use 'safe-outputs.create-issue', 'safe-outputs.create-pull-request', 'safe-outputs.add-comment', or 'safe-outputs.update-issue' to perform write operations safely.
    

Both errors were reproduced directly by compiling the exact snippet from the file with gh aw compile --validate.

Current correct syntax

  • The add-labels safe output uses the field max, not limit, to cap the number of labels applied.
  • permissions: should not declare pull-requests: write when safe-outputs.add-labels is used — safe-outputs performs the write on the agent's behalf and only read-level permissions are needed in the job. See https://github.github.com/gh-aw/reference/safe-outputs/

A corrected frontmatter block:

---
name: PR Labeler
on:
  pull_request:
    types: [opened, synchronize]
permissions:
  contents: read
safe-outputs:
  add-labels:
    max: 5
---

This was verified to compile successfully with gh aw compile --validate (no errors or warnings).

Suggested fix

In the .github/workflows/pr-labeler.md example inside the workshop file:

  • Replace limit: 5 with max: 5 under safe-outputs.add-labels.
  • Remove pull-requests: write from the permissions: block, keeping only contents: read.

Generated by 🔍 Workshop Sync Check · copilot · auto · 204.5 AIC · ⌖ 6.8 AIC · ⊞ 9.2K · ◷

  • expires on Oct 2, 2026, 8:58 AM UTC
Ngôn ngữ chính
JavaScript
Star
55
Fork
36
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

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 githubnext/gh-aw-workshop

Tất cả issue của githubnext/gh-aw-workshop

Issue tương tự

Thêm issue về JavaScript

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.