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

Invalid PR branch when used in repos with a leading dot #32

Closed
jezdez opened this issue Apr 29, 2021 · 6 comments
Closed

Invalid PR branch when used in repos with a leading dot #32

jezdez opened this issue Apr 29, 2021 · 6 comments
Assignees
Labels
bug Something isn't working feature request Idea for a new feature waiting for response Waiting for a response from the author

Comments

@jezdez
Copy link

jezdez commented Apr 29, 2021

🐞 Describe the bug

When trying to use the action from a repo whose name starts with a dot like .github (community health files), it fails with git errors when it tries to create the PR branch:

Error: Error: Command failed: git checkout -b "repo-sync/.github/default"
fatal: 'repo-sync/.github/default' is not a valid branch name.

📚 To Reproduce

Use the action in a repo whose name wouldn't be a valid Git branch.

💡 Expected behavior

Invalid characters in names should be filtered out.

🖼️ Screenshots

If applicable, add screenshots to help explain your problem.

⚙️ Environment

  • Action version: v.1.5.0

📋 Additional context

Alternatively it would be great to be able to specify the name of the branch, or the branch suffix.

@jezdez jezdez added the bug Something isn't working label Apr 29, 2021
@BetaHuhn
Copy link
Owner

Hey, thanks for creating the Issue!

This is definitely a problem which needs to be fixed.

Alternatively it would be great to be able to specify the name of the branch, or the branch suffix.

That seems to be the easiest solution and might be useful for other requirements as well. I will add an option to specify a custom branch prefix instead of the repo-sync/REPO_NAME.

I will start working on this tomorrow.

@BetaHuhn BetaHuhn added the feature request Idea for a new feature label Apr 29, 2021
@BetaHuhn BetaHuhn self-assigned this Apr 29, 2021
BetaHuhn added a commit that referenced this issue Apr 30, 2021
@BetaHuhn
Copy link
Owner

I implemented this on the develop branch.

You can try it out by using the action like this:

uses: BetaHuhn/repo-file-sync-action@develop
with:
    GH_PAT: ${{ secrets.GH_PAT }}
    BRANCH_PREFIX: custom-branch

I also added an example to the README which shows how you can use the BRANCH_PREFIX option.

@jezdez Let me know if this resolves your issue and I will merge this into master and release a new version.

@BetaHuhn
Copy link
Owner

BetaHuhn commented May 4, 2021

Friendly ping @jezdez

@BetaHuhn BetaHuhn added the waiting for response Waiting for a response from the author label May 4, 2021
@jezdez
Copy link
Author

jezdez commented May 4, 2021

Woops, sorry forgot to submit the form! Yep that did the trick, thank you :)

@BetaHuhn
Copy link
Owner

BetaHuhn commented May 5, 2021

No problem! 😄

@BetaHuhn
Copy link
Owner

BetaHuhn commented May 5, 2021

🎉 This issue is resolved in version v1.6.0 🎉

To use the latest version, use the Action with the v1 tag:

uses: BetaHuhn/repo-file-sync-action@v1

Or the latest tag:

uses: BetaHuhn/repo-file-sync-action@latest

@BetaHuhn BetaHuhn closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature request Idea for a new feature waiting for response Waiting for a response from the author
Projects
None yet
Development

No branches or pull requests

2 participants