action-label-syncer icon indicating copy to clipboard operation
action-label-syncer copied to clipboard

Label sync job completes, but does not update or change labels

Open mrz1836 opened this issue 1 year ago • 9 comments

Hi! I have used this workflow in many repositories, private and public and it was working great. However, in my most recent repository, the label sync is not working. The job completes successfully, no error, and no labels affected.

Example running the workflow: Screenshot 2023-04-11 at 8 11 47 AM

Example of old labels: Screenshot 2023-04-11 at 8 12 00 AM

Here is my .labels file which triggers the build:

Screenshot 2023-04-11 at 8 12 10 AM

Any ideas why its failing? Did GitHub change something?

mrz1836 avatar Apr 11 '23 12:04 mrz1836

Here is also the workflow

# Workflow: https://github.com/micnncim/action-label-syncer
# Export your labels: https://github.com/micnncim/label-exporter
name: sync-labels
on:
  push:
    branches:
      - master
    paths:
      - .github/labels.yml
jobs:
  sync-labels:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: micnncim/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          manifest: .github/labels.yml

mrz1836 avatar Apr 11 '23 12:04 mrz1836

Hi @micnncim ! Any chance you can check this out? It has been happening to new repos in the past two weeks I have noticed.

mrz1836 avatar Apr 17 '23 16:04 mrz1836

I figured out the issue. Repos by default don't have enough permissions. However, it would be nice to error out so that the user knows there is an issue.

This is the setting that made it work:

Screenshot 2023-04-17 at 2 14 51 PM

mrz1836 avatar Apr 17 '23 18:04 mrz1836

Yeah unfortunately it's pretty difficult to tell if this is the issue, we need (if nothing else) the responses printed.

thclark avatar May 18 '23 08:05 thclark

Not really an issue, it's a matter of setting the right permissions for the workflow.

permissions:
  pull-requests: write

Or you can adjust the general workflow permissions setting (like screenshot above) in your actions settings.

klaasnicolaas avatar May 22 '23 22:05 klaasnicolaas

Note, needs a dash not an underscore:

permissions:
  pull-requests: write

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

Otherwise you'll get:

The workflow is not valid. .github/workflows/labels.yml (Line: 4, Col: 3): Unexpected value 'pull_requests'

hugovk avatar Jul 03 '23 15:07 hugovk

I can't get it to work, my workflow is in a central repo, has read and write permissions like shown in the screenshot above and no permissions set in the workflow, and I see this in the logs

label: epic deleted from: nginxinc/kubernetes-ingress
label: release engineering deleted from: nginxinc/kubernetes-ingress
label: investigating deleted from: nginxinc/kubernetes-ingress
label: story deleted from: nginxinc/kubernetes-ingress

but the labels are still there.

I also noticed that this was happening for a while even when the workflow was running in the same repo (that has the same settings).

lucacome avatar Jul 25 '23 01:07 lucacome

I've reported both to GitHub. Edit: GitHub has removed both spammers.

hugovk avatar Feb 21 '24 05:02 hugovk