github / github/command

"maintain" cannot be used to verify actor permissions

Đang mở
#101 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
JavaScript
Star
167
Fork
17
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Describe the Issue

The "maintain" permission cannot be used to to verify the actor permissions. As a user with the "maintain" permission I would expect the following configuration to work. However, a comment is created that I only have the "write" permission.

Reading the GH API docs, it clearly states the "permission" field uses legacy base roles and that "maintain" is mapped to "write" [(ref)](https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2026-03-10#get-repository-permissions-for-a-user). So the output is expected but it is not clearly stated in this Action's documentation. Furthermore, using this legacy permission field of the API prevents us from differentiating between users with the write and users with the maintain role. In our case, we only want maintainers to be able to use the defined command and not developers with the "write" role.

### Action Configuration

```yaml
steps:
- uses: github/command@v2
id: command
with:
command: "/tf-apply"
permissions: maintain,admin
allowed_contexts: pull_request
reaction: "rocket"
skip_ci: true
```

### Relevant Actions Log Output

```
👋 , seems as if you have not maintain/admin permissions in this repo, permissions: write
```

### Extra Information

_No response_

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

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với cấu hình github/command@v2 được cung cấp và bước kiểm tra quyền tạo ra đầu ra log được hiển thị. So sánh trường quyền của GitHub API với các vai trò maintain và write, sau đó xác minh hành vi bằng cấu hình workflow được cung cấp. Được xem là hoàn tất khi có thể phân biệt người dùng maintain với người dùng write, hoặc khi giới hạn này được ghi rõ trong tài liệu nếu API không hỗ trợ việc phân biệt đó.

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

Đánh giá

Công nghệ
github-actions, javascript
Lĩnh vực
ci-cd
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

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.