Skip to content

Workflow with pull_request_target is not working #101

@MelleD

Description

@MelleD

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  }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions