github / github/issue-labeler

Workflow with pull_request_target is not working

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

Mô tả

I try to use `pull_request_target` (for fork PRs) to add label to the PR, but I get always

```
Run github/issue-labeler@v3.4
Configuration file (path: .github/labeler.yml) does not exist locally, fetching via the API
Could not add label(s) bugfix to issue #746
Error: AggregateError
```

With `pull_request` trigger it's working for my own PRs, but not for the for PR.
I think it's a permissions problem, but I don't understand what I need to change.

```
name: 'Build'

on:
pull_request_target:
branches:
- main
push:
branches:
- main

permissions:
issues: write
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v3.4
if: github.event_name == 'pull_request_target'
with:
configuration-path: .github/labeler.yml
include-title: 1
include-body: 0
enable-versioned-regex: 0
repo-token: ${{ secrets.GITHUB_TOKEN }}
```

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 trigger pull_request_target và khối permissions của workflow, sau đó kiểm tra hành vi của github/issue-labeler@v3.4 liên quan đến .github/labeler.yml và repo-token. Tái hiện lỗi bằng một pull request từ fork và so sánh với trường hợp pull_request hoạt động. Hoàn thành khi action có thể thêm label được yêu cầu vào pull request mà không xảy ra AggregateError.

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, typescript
Lĩnh vực
ci-cd
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/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.