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

Giving regex flags #9

Closed
saihaj opened this issue Apr 3, 2020 · 5 comments
Closed

Giving regex flags #9

saihaj opened this issue Apr 3, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@saihaj
Copy link

saihaj commented Apr 3, 2020

How can I set flags to ignore case? I know it is /i but need help with putting it in the .yml

@saihaj saihaj changed the title Case sensitive Giving regex flags Apr 3, 2020
@stephanmiehe stephanmiehe added the enhancement New feature or request label Apr 4, 2020
@stephanmiehe
Copy link
Collaborator

@saihaj this is not currently supported but feel free to file a PR to add this

@jsosulska
Copy link

Hello - I would like to report that the regex flag is not working for me.

Reproduction steps:

  • Create .github/issue-labeler.yml and .github/workflows/issue-labeler.yml.
  • Use existing workflow file, version 2.2
  • In issue labeler, use the following options:
cli: 
  - '/(cli|commandline)/i'
  • Create an issue with the word "cLi", to trigger insensitivity.
  • Run Action:
##[warning]Unexpected input(s) 'not-before', 'enable-versioned-regex', valid inputs are ['repo-token', 'configuration-path']
Run github/issue-labeler@v2.2
Removing label theme/cli from issue #7
(node:2602) UnhandledPromiseRejectionWarning: HttpError: Label does not exist
    at /home/runner/work/_actions/github/issue-labeler/v2.2/node_modules/@octokit/request/dist-node/index.js:66:23
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2602) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2602) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:2602) UnhandledPromiseRejectionWarning: HttpError: Label does not exist
    at /home/runner/work/_actions/github/issue-labeler/v2.2/node_modules/@octokit/request/dist-node/index.js:66:23
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2602) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by 

I have even tried something simple, like so:

windows:
  - '/windows/i'

As of right now, Case insensitivity is not working.

@bflad
Copy link

bflad commented May 24, 2021

It appears that #15 may not be present in a tagged release: v2.3...master

Could a maintainer please cut a release with that support?

A workaround might be to point to the current master branch commit: uses: github/issue-labeler@ 0207bb58c165f7229d560291b28d8de891bc46d1, which I'll try to verify in a few minutes and report back if that does not work.

@bflad
Copy link

bflad commented May 24, 2021

Hmm, there may be other issues with using the full SHA:

# .github/workflows/issue-labeler.yml
name: "Issue Labeler"
on:
  issues:
    types: [opened, edited]

jobs:
  triage:
    runs-on: ubuntu-latest
    steps:
    - uses: github/issue-labeler@0207bb58c165f7229d560291b28d8de891bc46d1
      with:
        repo-token: "${{ secrets.GITHUB_TOKEN }}"
        configuration-path: .github/labeler.yml
        enable-versioned-regex: 0

# .github/labeler.yml
wontfix:
  - '/(cli|commandline)/i'
Error: Cannot find module '@actions/core'
Require stack:
- /home/runner/work/_actions/github/issue-labeler/0207bb58c165f7229d560291b28d8de891bc46d1/lib/main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/work/_actions/github/issue-labeler/0207bb58c165f7229d560291b28d8de891bc46d1/lib/main.js:19:27)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/_actions/github/issue-labeler/0207bb58c165f7229d560291b28d8de891bc46d1/lib/main.js'
  ]
}

Reference: https://github.com/bflad/go-module-three/runs/2656622695?check_suite_focus=true

@stephanmiehe
Copy link
Collaborator

A new release has been cut for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants