Skip to content

Conversation

@Alw3ys
Copy link
Contributor

@Alw3ys Alw3ys commented Jun 29, 2021

No description provided.

RUN pip3 install -r requirements.txt

CMD [ "python", "/app/rotate_keys.py" ]
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.

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