Workflow with pull_request_target is not working
- Vorherrschende Sprache
- TypeScript
- Sterne
- 237
- Forks
- 55
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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 }}
```
Beitragsleitfaden
Rechercherichtung
Start with the workflow's pull_request_target trigger and permissions block, then inspect github/issue-labeler@v3.4 behavior around .github/labeler.yml and repo-token. Reproduce the failure with a fork pull request and compare it with the working pull_request case. Done means the action can add the requested label to the pull request without the AggregateError.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- github-actions, typescript
- Bereich
- ci-cd
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100