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

feat: support org secrets #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Alw3ys
Copy link
Contributor

@Alw3ys Alw3ys commented Jun 29, 2021

No description provided.

CMD [ "python", "/app/rotate_keys.py" ]
Copy link
Contributor

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)
Copy link
Contributor

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):
Copy link
Contributor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants