Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR labeler not using configuration file on forks #81

Open
JeffGreiner-eaton opened this issue Apr 27, 2023 · 1 comment
Open

PR labeler not using configuration file on forks #81

JeffGreiner-eaton opened this issue Apr 27, 2023 · 1 comment

Comments

@JeffGreiner-eaton
Copy link

JeffGreiner-eaton commented Apr 27, 2023

We are currently using the default setup for pr-labeler with the exception of using (pull_request_target).

here is the file

on:
  pull_request_target:
    types: [opened]

permissions:
  contents: read

jobs:
  pr-labeler:
    permissions:
      contents: read
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - uses: TimonVS/pr-labeler-action@v4
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          configuration-path: .github/pr-labeler.yml

and the config file located in root of .github is this file

master: ['hotfix/*', 'release/*', 'dev/*']
external-dependency: ['combined/*', 'combined-dependabot/*']
dev: ['feature/*', 'feat/*']

When a fork PR is opened the workflow runs but creates a label from the branch name and not the label configured.
Ex - branch name "feature/what-ever" is creating a label "feature" and should be creating the label "dev" instead.

Also a separate question for pr-labeler and reusable-workflows.

Is there an option to have everything for pr-labeler to reside in one file and move the configuration "labels" in to the workflow itself to make it easier to re-use the workflow. Having issues along the same here on normal pull requests and the configuration-path is not getting pulled in and skipping, then creating a label base on the open branch name.

Thanks for any insight here, we use the pr-labeler in 34 repositories

@jamesrenaud
Copy link

@JeffGreiner-eaton looking at the code, the action is pulling config from the context of where the action is running. I believe because the action runs as part of the parent repository (not the fork) the configuration is being pulled from the parent context.

Can you explain your forking logic? Are you forking public repos into private organizations to maintain changes yourself?

It might be possible to pass a different reference location for the config using the with parameters, but I'd need to investigate a bit further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants