Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
!./LICENSE
!./version
!./requirements.txt
!./scripts/
!./githubsecrets/
!./entrypoint.sh
Empty file removed __init__.py
Empty file.
13 changes: 7 additions & 6 deletions scripts/githubsecrets.py → githubsecrets/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import click
from .config import pass_config, pass_validate, create_artifacts, list_by_comma, print_pretty_json, is_docker
from .config import pass_config, pass_validate, create_artifacts, \
list_by_comma, print_pretty_json, is_docker
from .profile import Profile
from .secret import Secret

Expand Down Expand Up @@ -65,7 +66,7 @@ def profile_apply(
profile_name, github_owner, personal_access_token
):
"""[pa] Create or modify multiple profiles providing a string delimited by commas ","\n
Example: ghs profile-apply -p 'willy, oompa'"""
Example: ghs profile-apply -p 'willy, oompa'""" # noqa: 501
profile_names = list_by_comma(profile_name)
for prof_name in profile_names:
profile = Profile(config, prof_name)
Expand Down Expand Up @@ -111,7 +112,7 @@ def secret_apply(
repository, profile_name, secret_name, secret_value
):
"""[sa] Apply to multiple repositories providing a string delimited by commas ","\n
Example: ghs secret-apply -p willy -r 'githubsecrets, serverless-template'"""
Example: ghs secret-apply -p willy -r 'githubsecrets, serverless-template'""" # noqa: 501
profile = Profile(config, profile_name)
repositories = list_by_comma(repository)
responses = []
Expand All @@ -133,7 +134,7 @@ def secret_delete(
repository, profile_name, secret_name
):
"""[sd] Delete secrets from multiple repositories providing a string delimited by commas ","\n
Example: ghs secret-delete -p willy -r 'githubsecrets, serverless-template'"""
Example: ghs secret-delete -p willy -r 'githubsecrets, serverless-template'""" # noqa: 501
profile = Profile(config, profile_name)
repositories = list_by_comma(repository)
responses = []
Expand All @@ -154,7 +155,7 @@ def secret_get(
repository, profile_name, secret_name
):
"""[sg] Get secrets from multiple repositories providing a string delimited by commas ","\n
Example: ghs secret-get -p willy -r 'githubsecrets, serverless-template'"""
Example: ghs secret-get -p willy -r 'githubsecrets, serverless-template'""" # noqa: 501
profile = Profile(config, profile_name)
repositories = list_by_comma(repository)
responses = []
Expand All @@ -174,7 +175,7 @@ def secret_list(
repository, profile_name
):
"""[sl] List secrets of multiple repositories providing a string delimited by commas ","\n
Example: ghs secret-delete -p willy -r 'githubsecrets, serverless-template'"""
Example: ghs secret-delete -p willy -r 'githubsecrets, serverless-template'""" # noqa: 501
profile = Profile(config, profile_name)
repositories = list_by_comma(repository)
responses = []
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/profile.py → githubsecrets/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def lista():
msg = "\n"
if not credentials_content:
error_exit(
f"WARNING: Couldn't find any profile, create one by executing:\nghs profile-apply -p profile_name\n") # noqa: E501
"WARNING: Couldn't find any profile, create one by executing:\nghs profile-apply -p profile_name\n") # noqa: E501
for key, value in credentials_content.items():
token_length = len(value['personal_access_token'])
value['personal_access_token'] = \
Expand Down
1 change: 0 additions & 1 deletion scripts/secret.py → githubsecrets/secret.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import click
import requests
import json
from base64 import b64encode
from nacl import encoding, public
from .config import error_exit
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from scripts import githubsecrets
from githubsecrets import cli

if __name__ == '__main__':
githubsecrets.cli()
cli.cli()
Empty file removed scripts/__init__.py
Empty file.
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
],
entry_points='''
[console_scripts]
ghs=scripts.githubsecrets:cli
ghs=githubsecrets.cli:cli
''',
setup_requires=[
'setuptools>=44.1.0',
Expand All @@ -38,12 +38,12 @@
'docutils>=0.16'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
],
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
],
)