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
More on Contexts, Expressions, Env & Outputs
List the available contexts and what each holds.BeginnerWhich contexts can you use in which keys? Give two examples that trip people up.AdvancedWhat are the expression operators and how do comparisons coerce types?IntermediateHow do you write a ternary in GitHub Actions expressions?IntermediateWhat do `contains`, `startsWith`, `endsWith`, `format` and `join` do?BeginnerWhat are object filters (`.*`) and how are they useful?Intermediate