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

Simply doesn't work #289

Open
lukepighetti opened this issue Mar 23, 2022 · 4 comments
Open

Simply doesn't work #289

lukepighetti opened this issue Mar 23, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@lukepighetti
Copy link

lukepighetti commented Mar 23, 2022

Hello, I tried to use this to extract 1.0.0 from refs/heads/release/1.0.0, but failed.

jobs:
  deploy:
    name: Deploy to TestFlight
    runs-on: macos-latest
    timeout-minutes: 60

    steps:
      - uses: actions-ecosystem/action-regex-match@v2
        id: branch-version-regex
        with:
          text: "${{ github.ref }}"
          regex: '\d+\.\d+\.\d+$'

      - run: echo '${{ github.ref }}'
      - run: echo '${{ steps.branch-version-regex.outputs.group1 }}'

This outputs

  • echo 'refs/heads/release/1.0.0'
  • echo ''

This regex was crafted with https://regex101.com in JavaScript mode

@lukepighetti lukepighetti added the bug Something isn't working label Mar 23, 2022
@kaisugi
Copy link
Contributor

kaisugi commented May 12, 2022

seems duplicated to #158
use .+? instead of \d+

@ayushishah-easternts
Copy link

/<a [^>]\bhref\s=\s*"([^"]vercel.app[^"])/

This is not working for me @kaisugi @lukepighetti

@lukepighetti
Copy link
Author

seems duplicated to #158
use .+? instead of \d+

. and \d are not the same delimiters

@jtmuller5
Copy link

It seems like the issue is that group1 can be empty while match contains a value. I used this code to extract the version name from a git tag (v1.5.5+157):

- name: 'Extract version name from tag'
        uses: actions-ecosystem/action-regex-match@v2
        id: version-name
        with:
          text: ${{ env.VERSION_NAME }}
          regex: '[0-9]+\.[0-9]+\.[0-9]+' # https://regexr.com/

When I printed out the results, group1 is blank and match contained the correct value (1.5.5):

 - name: 'Print extracted values'
        run: |
          echo ${{ steps.version-name.outputs.group1 }} // ''
          echo ${{ steps.version-name.outputs.match }} // '1.5.5'

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

4 participants