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

[BUG] Action fails when branch name contains parentheses #88

Closed
2 tasks done
srubin opened this issue Sep 14, 2021 · 3 comments · Fixed by #89
Closed
2 tasks done

[BUG] Action fails when branch name contains parentheses #88

srubin opened this issue Sep 14, 2021 · 3 comments · Fixed by #89
Labels
bug Something isn't working

Comments

@srubin
Copy link

srubin commented Sep 14, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug?

The branch-names action fails when the current branch contains a parenthesis.

To Reproduce

Using this basic action on a branch named srubin-(patch)-1

name: CI
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Branch Names
        uses: tj-actions/branch-names@v4.9

I'm seeing this error:

2021-09-14T16:05:05.5032103Z ##[group]Run tj-actions/branch-names@v4.9
2021-09-14T16:05:05.5032717Z with:
2021-09-14T16:05:05.5033110Z ##[endgroup]
2021-09-14T16:05:05.5174524Z ##[group]Run if [[ "refs/pull/2/merge" != "refs/tags/"* ]]; then
2021-09-14T16:05:05.5175143Z �[36;1mif [[ "refs/pull/2/merge" != "refs/tags/"* ]]; then�[0m
2021-09-14T16:05:05.5175584Z �[36;1m  BASE_REF=main�[0m
2021-09-14T16:05:05.5175974Z �[36;1m  HEAD_REF=srubin-(patch)-1�[0m
2021-09-14T16:05:05.5176397Z �[36;1m  REF=refs/pull/2/merge�[0m
2021-09-14T16:05:05.5176944Z �[36;1m  echo "::set-output name=base_ref_branch::${BASE_REF/refs\/heads\//}"�[0m
2021-09-14T16:05:05.5177613Z �[36;1m  echo "::set-output name=head_ref_branch::${HEAD_REF/refs\/heads\//}"�[0m
2021-09-14T16:05:05.5178173Z �[36;1m  REF_BRANCH=${REF/refs\/pull\//}�[0m
2021-09-14T16:05:05.5178712Z �[36;1m  echo "::set-output name=ref_branch::${REF_BRANCH/refs\/heads\//}"�[0m
2021-09-14T16:05:05.5179191Z �[36;1mfi�[0m
2021-09-14T16:05:05.5225692Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2021-09-14T16:05:05.5226286Z ##[endgroup]
2021-09-14T16:05:05.5309215Z /home/runner/work/_temp/36554ad0-33c6-4697-95ac-da67b726770d.sh: line 3: syntax error near unexpected token `('
2021-09-14T16:05:05.5324451Z ##[error]Process completed with exit code 2.

image

What OS are you seeing the problem on?

ubuntu-latest

Expected behavior?

I expect branch-names to work with any branch name that is a valid git branch name.

Relevant log output

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@srubin srubin added the bug Something isn't working label Sep 14, 2021
@github-actions
Copy link

Thanks for reporting this issue.

jackton1 added a commit that referenced this issue Sep 14, 2021
@jackton1
Copy link
Member

@srubin This should be resolved in the latest release. Thanks

@srubin
Copy link
Author

srubin commented Sep 14, 2021

Thanks for the quick fix!

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

Successfully merging a pull request may close this issue.

2 participants