Interview Prep/GitHub Actions/Contexts, Expressions, Env & Outputs

What does the `job` context contain?

IntermediateConceptContexts, Expressions, Env & Outputs
Answer

job.status (success, failure, cancelled), job.container.id and job.container.network when the job runs in a container, and job.services.<id>.ports with the mapped host ports of service containers. That last one is how you avoid fixed ports:

services:
  redis:
    image: redis:7
    ports: ["6379"]   # random host port
steps:
  - run: redis-cli -p ${{ job.services.redis.ports['6379'] }} ping
All GitHub Actions questions Roadmap: GitHub Actions

More on Contexts, Expressions, Env & Outputs