-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Summary
When service container ports include a protocol suffix (e.g., 8080:80/tcp), the autocomplete for job.services.<id>.ports.* incorrectly includes the protocol suffix in the port key.
Current Behavior
Given a workflow with:
services:
redis:
image: redis
ports:
- 6379:6379
- 8080:80/tcpAutocomplete for ${{ job.services.redis.ports.| }} shows:
637980/tcp❌
Expected Behavior
Autocomplete should show:
637980✅
This matches the runner's actual behavior - at runtime, job.services.redis.ports.80 returns the host port, not job.services.redis.ports.80/tcp.
Details
The port parsing logic in languageservice/src/context-providers/job.ts splits on : but doesn't strip the optional /tcp or /udp protocol suffix:
const portParts = item.toString().split(":");
const containerPort = portParts.length === 2 ? portParts[1] : portParts[0];Suggested Fix
Strip the protocol suffix after extracting the container port:
const portParts = item.toString().split(":");
let containerPort = portParts.length === 2 ? portParts[1] : portParts[0];
containerPort = containerPort.split("/")[0]; // Strip protocol suffixMetadata
Metadata
Assignees
Labels
No labels