Which contexts can you use in which keys? Give two examples that trip people up.
AdvancedConceptContexts, Expressions, Env & Outputs
Answer
Availability is per key, documented in the "context availability" table. Two common traps:
jobs.<id>.runs-oncan usegithub,needs,strategy,matrix,vars,inputs, but notenvorsecrets.jobs.<id>.ifcannot useenv,stepsorrunner, and noifcan referencesecretsdirectly (Unrecognized named-value: 'secrets'). Map the secret intoenvat job level and testenv.X != ''at step level.
concurrency at workflow level cannot use env, matrix or needs either.
More on Contexts, Expressions, Env & Outputs
List the available contexts and what each holds.BeginnerWhat 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?IntermediateWhat do `toJSON` and `fromJSON` do, and give a real use of each?Intermediate