-
-
Notifications
You must be signed in to change notification settings - Fork 0
Move user config into separate file #3
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
Conversation
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
This PR extracts the user-to-key mapping out of the main script into its own configuration file, adds version metadata to sync-ssh-keys.sh, and updates documentation and CI workflows to support automated tagging and release.
- Introduce a standalone
users.confforUSER_KEYSdefinitions - Update
sync-ssh-keys.shto sourceusers.confand setSCRIPT_VERSION - Revise README and add GitHub Actions workflows for version checks and releases
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| users.conf | New file defining USER_KEYS associative array for user SSH key URLs |
| sync-ssh-keys.sh | Removed inline config, added loading of users.conf, and bumped SCRIPT_VERSION |
| README.md | Updated configuration instructions to reference users.conf and added execution step |
| .github/workflows/release.yml | New workflow to extract SCRIPT_VERSION, tag, and publish a release |
| .github/workflows/check-version.yml | New PR check to ensure SCRIPT_VERSION is bumped before merging |
Comments suppressed due to low confidence (4)
.github/workflows/release.yml:12
- Add
fetch-depth: 0to the checkout step to ensure that all tags are fetched and available when creating or verifying tags.
- name: Checkout code
sync-ssh-keys.sh:6
- There are no tests covering the new configuration loading logic (missing file, syntax error). Consider adding unit or integration tests to verify behavior when
users.confis absent or invalid.
# === Load user configuration ===
users.conf:1
- [nitpick] It would be helpful to add a header comment explaining the purpose of
users.conf, the expected format for theUSER_KEYSentries, and allowed methods.
declare -A USER_KEYS=(
sync-ssh-keys.sh:12
- Sourcing the entire users.conf file can execute arbitrary code if the file is compromised. Consider validating its contents or using a safer parsing approach (e.g., reading line-by-line).
if ! source "$SCRIPT_DIR/users.conf"; then
No description provided.