D1: Expressions & Evaluation
GH-200 GitHub Actions exam practice questions · 10 flashcards
Question
Expression syntax?
1 / 10
Tip: Space flips the card, ← / → navigate.
Show all 10 Expressions & Evaluation practice questions and answers
- Expression syntax?${{ <expression> }}; if: conditions may omit the braces.
- Operators?==, !=, <, >, &&, ||, !, ().
- Functions?contains(), startsWith(), endsWith(), format(), join(), toJSON(), fromJSON(), hashFiles().
- hashFiles()?Hash of matched files, used for cache keys.
- Literal types?boolean, null, number, string ('single quotes').
- Static vs runtime evaluation?Some contexts (e.g. env in some keys, matrix definition) are evaluated at parse; most step expressions evaluate at runtime on the runner.
- Where can't secrets be used?In if: conditions directly; map to env then check.
- Preventing secret leakage?Don't echo secrets, avoid toJSON(secrets), mask derived values, avoid passing secrets via command-line args.
- Script injection risk with expressions?${{ github.event.issue.title }} inside run: injects untrusted text — use env vars instead.
- Object filters?github.event.commits.*.message to select arrays of properties.