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

problem for multiple matches #230

Open
LouisCoilliot opened this issue Sep 30, 2021 · 1 comment
Open

problem for multiple matches #230

LouisCoilliot opened this issue Sep 30, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@LouisCoilliot
Copy link

What happened

Using :

      - uses: actions-ecosystem/[email protected]
        id: regex-match
        with:
          text: "${{ steps.changed-files.outputs.all_modified_files }}"
          regex: 'inventory\/(.*?)\/'
          # all matches, not just first one
          flags: gm
      - name: debug steps.regex-match.outputs
        run: echo "$DBG"
        env:
          DBG: ${{ toJson(steps.regex-match.outputs) }}

The search being (from the job logs):

Run actions-ecosystem/[email protected]
  with:
    text: inventory/usglb-dev1/inventory.ini,inventory/usglb-dev2/inventory.ini
    regex: inventory\/(.*?)\/
    flags: gm

What you expected to happen

It should match 'usglb-dev1' AND 'usglb-dev2'

It only matches :

Run echo "$DBG"
{
  "match": "inventory/usglb-dev1/",
  "group1": "usglb-dev1"
}

I checked the regex, see image in attachment.

regex-test

Regards,

Louis

Louis

@LouisCoilliot LouisCoilliot added the bug Something isn't working label Sep 30, 2021
@LouisCoilliot
Copy link
Author

Instead of

{
  "match": "inventory/usglb-dev1/",
  "group1": "usglb-dev1"
}

I would expect something like :

[
  {
    "match": "inventory/usglb-dev1/",
    "group1": "usglb-dev1"
  },
  {
    "match": "inventory/usglb-dev2/",
    "group1": "usglb-dev2"
  }
]

Maybe this issue should be relabeled as feature enhancement.

Louis

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

1 participant