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

usage of branches or branches-ignore breaks workflow #79

Open
jeffvg opened this issue Mar 6, 2023 · 2 comments
Open

usage of branches or branches-ignore breaks workflow #79

jeffvg opened this issue Mar 6, 2023 · 2 comments

Comments

@jeffvg
Copy link

jeffvg commented Mar 6, 2023

Hi all,
I've been using PR-labeler for a over a year and works great. Since we started using the dependabot dependency update workflow and the security dependabot. The dependabot PR fails to run the PR labeler due to permissions. How can the current pr-labeler-action@v4 be configured to ignore dependabot PR's all together and not fail the job?

I've tried both these configs

name: PR Labeler
on:
  pull_request:
    types: [opened]
    branches:
      - '!dependabot/*'  //using not dependabot

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
name: PR Labeler
on:
  pull_request:
    types: [opened]
    branches-ignore:  //using branches-ignore
      - 'dependabot/*'

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
  • error
    image

thank you

@jamesrenaud
Copy link

@jeffvg are you still experiencing this issue?

I wasn't able to reproduce this, and the error seems to sound like a syntax problem.

@jamesrenaud
Copy link

Ah, this may also be because GitHub treats Dependabot PRs as Forks instead of actual PRs

https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/

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