action-label-syncer
action-label-syncer copied to clipboard
Label sync job completes, but does not update or change labels
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:
Example of old labels:
Here is my .labels file which triggers the build:
Any ideas why its failing? Did GitHub change something?
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
Hi @micnncim ! Any chance you can check this out? It has been happening to new repos in the past two weeks I have noticed.
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:
Yeah unfortunately it's pretty difficult to tell if this is the issue, we need (if nothing else) the responses printed.
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.
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'
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).
I've reported both to GitHub. Edit: GitHub has removed both spammers.