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

Sync not working on labels with exceptions #713

Open
1 of 5 tasks
Chefski opened this issue Dec 7, 2023 · 3 comments
Open
1 of 5 tasks

Sync not working on labels with exceptions #713

Chefski opened this issue Dec 7, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Chefski
Copy link

Chefski commented Dec 7, 2023

Description:
Sync doesn't seem to work for the directories which a label has exceptions in (partially. It removed one label). Maybe my file is setup wrong but some labels remain after there are no changes to a PR.
Xnip2023-12-06_23-59-05

The remaining labels in the screenshot are code and icons.

Maybe I'm testing it too extremely? Or it's just setup incorrectly

Action version:
5.0.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
Testing on a private test repo but here is the public repo if it helps.

name: "Label PRs"

on:
  - pull_request_target

jobs:
  label-prs:
    permissions:
      contents: read
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/labeler@v5
        with:
          sync-labels: true

docs:
  - changed-files:
    - any-glob-to-any-file: '*.md'
    - any-glob-to-any-file: .github/PULL_REQUEST_TEMPLATE/*.md
    - any-glob-to-any-file: .github/pull_request_template.md
    - any-glob-to-any-file: docs/**

icons:
  - changed-files:
    - any-glob-to-any-file: svgs/*
    - any-glob-to-any-file: app/assets/appfilter.xml

code:
  - all:
  - changed-files: # Not indented as it either had the same or better results
    - any-glob-to-any-file: 'app/**'
    - any-glob-to-all-files: '!app/src/main/res/*/strings.xml'
    - any-glob-to-all-files: '!app/assets/appfilter.xml'


locale:
  - changed-files:
    - any-glob-to-any-file: app/src/main/res/*/strings.xml
    

Expected behavior:
Each label will be removed after all changes have been removed.

Actual behavior:
Labels remain even after the PR has no changed files (only code, icons and/or locale

@Chefski Chefski added bug Something isn't working needs triage labels Dec 7, 2023
@MaksimZhukov
Copy link
Contributor

Hello @Chefski!
Thank you for reporting this!
We will take a look and contact you as soon as we have any updates!

@MaksimZhukov MaksimZhukov self-assigned this Dec 11, 2023
@lamdor
Copy link

lamdor commented Dec 11, 2023

So what I think is happening is that action/labeler@v5 is seeing a stale copy from a different branch. I'm trying to update the .github/labeler.yml on the dependabot PR that updates the action to v5 and that's where I was seeing this issue. But looking at the failing jobs, they doing The configuration file (path: .github/labeler.yml) was found locally, reading from the file. We use self-hosted runners where a different workflow could definitely checkout to run tests or whatnot. These checkouts stick around and rely on action/checkout to force it to be at the correct ref. What I'm hypothesizing is that actions/labeler@v5 is seeing the older checkout.

For right now, I'm going to add a actions/checkout@v4 step before the labeler to ensure that it's getting the labeler.yml from the correct branch.

@broksonic21
Copy link

@lamdor i was trying to repo as well in a non-private repo and had same thought - in our private repo, that would match what we see. To fix, we need a format that works in both v4 and v5 lest every branch needs to update at once, which is nearly impossible for companies. - or else it needs to read just from the appropriate branch it's running from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants