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

Run and add ssh key to agent #6

Merged
merged 2 commits into from
Nov 2, 2023
Merged
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
12 changes: 12 additions & 0 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,20 @@ def setup(self, _=None):
)
return
self.store_the_keys(*keys)

# Add the key to the ssh-agent.
self.add_key_to_ssh_agent()

self.output.value = "The keys were updated 👍"

def add_key_to_ssh_agent(self):
"""Add the key to the ssh-agent."""
subprocess.run(
["ssh-add", "-t", "1d", str(self.private_key_file)],
encoding="utf-8",
check=True,
)

def get_keys(self):
headers = {"Content-Type": "application/json", "Accept": "application/json"}

Expand Down
Loading