Fix create rule command in create_new_rspec github workflow
This commit is contained in:
parent
5744c7b409
commit
30cafe81f0
@ -32,7 +32,7 @@ def check_links(d):
|
||||
def create_rule(languages: str, user: Optional[str]):
|
||||
'''Create a new rule.'''
|
||||
token = os.environ.get('GITHUB_TOKEN')
|
||||
url = build_github_repository_url(token)
|
||||
url = build_github_repository_url(token, user)
|
||||
config = {}
|
||||
if user:
|
||||
config['user.name'] = user
|
||||
|
@ -7,9 +7,12 @@ from contextlib import contextmanager
|
||||
|
||||
from rspec_tools.utils import copy_directory_content
|
||||
|
||||
def build_github_repository_url(token: str):
|
||||
def build_github_repository_url(token: str, user: Optional[str]):
|
||||
'Builds the rspec repository url'
|
||||
return f'https://{token}@github.com/SonarSource/rspec.git'
|
||||
if user:
|
||||
return f'https://{user}:{token}@github.com/SonarSource/rspec.git'
|
||||
else:
|
||||
return f'https://{token}@github.com/SonarSource/rspec.git'
|
||||
|
||||
def extract_repository_name(url):
|
||||
url_end = url.split('/')[-2:]
|
||||
|
Loading…
x
Reference in New Issue
Block a user