labeler
labeler copied to clipboard
"Common Examples" fails to execute
This action fails when using the "Common Examples" example from the readme:
workflows/label.yml:
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md
name: Labeler
on: [pull_request]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
labeler.yml:
# Add 'repo' label to any root file changes
repo:
- ./*
# Add '@domain/core' label to any change within the 'core' package
@domain/core:
- package/core/*
- package/core/**/*
# Add 'test' label to any change to *.spec.js files within the source dir
test:
- src/**/*.spec.js
# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
source:
- any: ['src/**/*', '!src/docs/*']
# Add 'frontend` label to any change to *.js files as long as the `main.js` hasn't changed
frontend:
- any: ['src/**/*.js']
all: ['!src/main.js']
yields following error in gh actions:
Set up job5s
Run actions/labeler@v21s
^
Run actions/labeler@v2
##[error]YAMLException: end of the stream or a document separator is expected at line 6, column 1:
@domain/core:
^
##[error]end of the stream or a document separator is expected at line 6, column 1:
@domain/core:
^
Complete job
I'm also seeing the examples fail, but differently.
source:
- any: ['src/**/*', '!src/docs/*']
run in isolation fails with:
##[error]TypeError: glob pattern string required
##[error]glob pattern string required
I'm also seeing the examples fail, but differently.
source: - any: ['src/**/*', '!src/docs/*']
run in isolation fails with:
##[error]TypeError: glob pattern string required ##[error]glob pattern string required
I didn't mention this in my issue but the "any" and "all" directives are not working for me either
The README is a bit outdated. any
and all
are only available on the master branch. You must use actions/labeler@master
until it is officially released.
So even with actions/labeler@master
we cant use any
and all
on pull requests?
So even with
actions/labeler@master
we cant useany
andall
on pull requests?
To clarify, with actions/labeler@master
, you CAN use any
and all
. I'm successfully using it.
Ah perfect, I'll try it now, thanks
It works, thanks a lot!
@mattwills8 heads up that I found a bug my original logic. Filed #75 to fix it. I'm still testing it, but hopefully it'll land soon.
Documentation update in #82.
@jalaziz - Let's go ahead and update readme.md. It created lot of confusion for me to fix the glob pattern issue. Without looking at this issue it would have had very difficult for me to use -any.
Let me know your thoughts on this.
@anandgupta193 There's already a PR open for that. I don't have permissions to approve or merge PRs on this repo, so unfortunately, there's not much I can do.
When will a release be created that allows us to use any
and all
? I'm trying to migrate my repos to this workflow from the deprecated probot autolabeleer (the apache spark repo to be correct), but it's difficult to use negations (!
) properly without any
and all
support.
Oddly, it looks like any
/all
was released https://github.com/marketplace/actions/labeler?version=v3 -- https://github.com/actions/labeler/commit/4b52aec09ba832eb9aecccddbccce644ba9ba69d lists v3.0.0
For anyone facing the issue that @kepikoi mentioned (using @domain/core):
It seems that the @
symbol is causing the error in the .yml parsing. Just remove the @
if you are getting this error:
##[error]YAMLException: end of the stream or a document separator is expected at line 6, column 1:
@domain/core:
^