Skip to content

Conversation

@alexandre-abrioux-rf
Copy link
Contributor

@alexandre-abrioux-rf alexandre-abrioux-rf commented Nov 5, 2025

Description of the changes

The next-release is broken because it is using an old public key from GitHub

Summary by CodeRabbit

  • Chores
    • Updated CI configuration to dynamically fetch and configure GitHub SSH host keys at pipeline runtime instead of relying on a static hard-coded key, ensuring known_hosts is populated reliably, reducing hard-coded secrets, and improving pipeline resilience and security.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

CircleCI config updated: the next-release step now dynamically fetches GitHub SSH keys from the GitHub API (curl + jq), prefixes each key with github.com, and appends them to ~/.ssh/known_hosts instead of adding a single hard-coded RSA key.

Changes

Cohort / File(s) Change Summary
CircleCI SSH configuration
\.circleci/config\.yml
Replaced static echo 'github.com ssh-rsa ...' >> ~/.ssh/known_hosts with `mkdir -p ~/.ssh && curl -sL https://api.github.com/meta | jq -r '.ssh_keys

Sequence Diagram(s)

sequenceDiagram
    participant CI as CircleCI runner
    participant GH as api.github.com
    Note over CI: previous flow (static)
    CI->>CI: mkdir ~/.ssh
    CI->>CI: echo 'github.com ssh-rsa ...' >> ~/.ssh/known_hosts

    Note over CI,GH: new flow (dynamic)
    CI->>GH: GET /meta
    GH-->>CI: JSON { ssh_keys: [...] }
    CI->>CI: jq -r '.ssh_keys | .[]'
    CI->>CI: sed -e 's/^/github.com /'
    CI->>CI: append to ~/.ssh/known_hosts
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Single-file CI config change, small command pipeline.
  • Items to check:
    • Verify jq is available in the CI environment or install it.
    • Validate network access and error handling if GitHub API is unavailable.
    • Ensure resulting known_hosts entries match required SSH key formats.

Suggested reviewers

  • MantisClone
  • aimensahnoun
  • LeoSlrRf

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description explains why the change is needed (old public key broken) but lacks technical details about the solution and implementation approach. Expand the description to explain what changed: the solution now dynamically retrieves GitHub SSH keys via their API instead of using a hardcoded static key, and why this approach is better.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ci(next-release): fix github ssh key' directly and concisely describes the main change: fixing the SSH key configuration in the CI next-release workflow.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-release-ssh-key

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d8acb8 and cfebd34.

📒 Files selected for processing (1)
  • .circleci/config.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-and-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- *enable_corepack
- run:
name: 'Allow github ssh host'
command: mkdir ~/.ssh; echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
Copy link
Contributor Author

@alexandre-abrioux-rf alexandre-abrioux-rf Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This public key was deprecated in 2023, see https://github.blog/news-insights/company-news/we-updated-our-rsa-ssh-host-key/

The authorized public keys are listed here: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints

I'm not sure why the next-release pipeline was still functioning after 2023, even though the key had been deprecated. I suspect that CircleCI was already prefilling the file /home/circleci/.ssh/known_hosts with the proper GitHub keys, so we didn't need to update our workflow. I also suspect that they stopped prefilling the file today following this incident.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6aabfa and 7d8acb8.

📒 Files selected for processing (1)
  • .circleci/config.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-and-test

- run:
name: 'Allow github ssh host'
command: mkdir ~/.ssh; echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
command: mkdir -p ~/.ssh && curl -sL https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a static value, we now get the latest values from GitHub's API

Copy link
Member

@MantisClone MantisClone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! 👍 Sorry for the delay 🙇

@alexandre-abrioux-rf alexandre-abrioux-rf merged commit d2a9512 into master Nov 7, 2025
10 checks passed
@alexandre-abrioux-rf alexandre-abrioux-rf deleted the fix-release-ssh-key branch November 7, 2025 08:22
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.

4 participants