-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: support org secrets #10
base: master
Are you sure you want to change the base?
Conversation
CMD [ "python", "/app/rotate_keys.py" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as good practice you shouldn't commit whitespace-only changes to files. I'm a believer in "newline at EOF" but it's not good to have random changes like this.
(public_key, pub_key_id) = get_org_pub_key(repo, github_token) | ||
|
||
# encrypt the secrets | ||
encrypted_access_key = encrypt(public_key, new_access_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this conditional creates a LOT of duplicated code. only one line is different between the branches.
@@ -131,7 +144,27 @@ def get_pub_key(owner_repo, github_token): | |||
|
|||
return (public_key, public_key_id) | |||
|
|||
def upload_secret(owner_repo,key_name,encrypted_value,pub_key_id,github_token): | |||
def get_org_pub_key(org, github_token): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a way to refactor this to reduce the duplicated code, but it's not as easy as the conditional above. (the trick would be to use optional arguments for owner_repo
and org
).
No description provided.