Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

[BUG] Unable to extract version info error #38

Closed
valchetski opened this issue Jul 13, 2020 · 8 comments
Closed

[BUG] Unable to extract version info error #38

valchetski opened this issue Jul 13, 2020 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@valchetski
Copy link

Description
Recently started receiving errors during running of action.
It says that it can't find version info.
Noticed that in 2.5.3 release VERSION_REGEX were changed to ^<Version>(.*)<\/Version>$ which doesn't ignore whitespaces in the beginning of the line

Failed Action Log URL
https://github.com/alexvolchetsky/yandex.alice.sdk/runs/864428591?check_suite_focus=true

To Reproduce
Test of ^<Version>(.*)<\/Version>$ on content of my .cspoj file:
https://regex101.com/r/ZpzZkk/3/
Can't match anything

Expected Behavior
Test of ^\s*<Version>(.*)<\/Version>$ on content of my .cspoj file:
https://regex101.com/r/ZpzZkk/2/
Matches version info

The same regex works if set VERSION_REGEX explicitly. For instance:

- name: publish on version change
    id: publish_nuget
    uses: rohith/publish-nuget@v2
    with:        
      PROJECT_FILE_PATH: ./src/Yandex.Alice.Sdk/Yandex.Alice.Sdk.csproj
      NUGET_KEY: ${{secrets.NUGET_API_KEY}}
      INCLUDE_SYMBOLS: true
      VERSION_REGEX: ^\s*<Version>(.*)<\/Version>$

Environment:

  • Platform: Ubuntu
  • Action Version: v2.5.3
@valchetski valchetski added the bug Something isn't working label Jul 13, 2020
@valchetski
Copy link
Author

@brandedoutcast please check my pr

@Logikoz
Copy link

Logikoz commented Jul 14, 2020

I had the same problem!

@marcopandolfo
Copy link

The same problem occurred to me, and i fixed it by explicitly placing the default regex (" (. *) <\ / Version>") in the "VERSION_REGEX" parameter, as was said by @alexvolchetsky

@brandedoutcast
Copy link
Owner

@alexvolchetsky I'm happy to make ^\s*<Version>(.*)<\/Version>$ as the default regex but I don't see any open PR. I'm pushing it on your behalf as this is bad & needs to be fixed ASAP

Thanks a lot for your contribution 🌟

@anibalvelarde
Copy link

anibalvelarde commented Jul 15, 2020

hello @alexvolchetsky, in my case, v2.5.3 still runs into the problem of not recognizing the version number correctly in the context of the full XML of the *.csproj file.

I tried the default RegEx, ^<Version>(.*)<\/Version>$, and it did not work. See failure here.

When I try the previous regex with v2.5.3, it works OK. See example RegEx here. But the new RegEx does not. It seems to be having problems matching in the context of the full XML body of the *.csproj file.

Here is an example of the previous regex, <Version>(.*)<\/Version>, working.
This may still be an issue. I'm trying to determine if it a problem specific to me.

@valchetski
Copy link
Author

hello @anibalvelarde , can you please try to use latest v2.5.4 and remove VERSION_REGEX: (.*)</Version> from your pipeline? That might solve your issue

@anibalvelarde
Copy link

Hello @alexvolchetsky, I was able to re-try with v2.5.4. Happy to report it worked like a charm! Thanks!

@Leitee
Copy link

Leitee commented Aug 22, 2021

In my case, it was due I was using the Label attribute in the tag. 0.9.1.
By using JS console, I managed to make it work by just removing that attribute.
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants