Skip to content

refactor: extract get_public_ip into shared helpers.sh#1056

Open
Kewe63 wants to merge 2 commits into
base:mainfrom
Kewe63:refactor/shared-get-public-ip-helper-v2
Open

refactor: extract get_public_ip into shared helpers.sh#1056
Kewe63 wants to merge 2 commits into
base:mainfrom
Kewe63:refactor/shared-get-public-ip-helper-v2

Conversation

@Kewe63
Copy link
Copy Markdown

@Kewe63 Kewe63 commented May 11, 2026

Summary

Centralizes public IP detection logic into a shared helper script.

Problem

Identical 23-line implementations of get_public_ip() were duplicated in multiple entrypoints, violating DRY principles.

Solution

  • Created helpers.sh with a single validated implementation.
  • Updated entrypoints to source ./helpers.sh.
  • Added error handling for curl failures under set -e.

Verification

  • Verified functionality remains identical.

Impact

Reduces maintenance burden.

@cb-heimdall
Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

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