Maven / GitHub Actions Interview Questions
What are the key GitHub Actions expression contexts and what information does each provide?
Contexts are namespaced objects available inside ${{ }} expressions throughout a workflow. Each context exposes a different slice of information about the run, the repository, or the execution environment.
| Context | Key properties | Example use |
|---|---|---|
github |
ref, sha, event_name, actor, repository, run_id, workflow |
if: github.ref == 'refs/heads/main' |
env |
All environment variables set via env: at any scope |
${{ env.APP_VERSION }} |
secrets |
Encrypted secrets from repo/org/environment settings | ${{ secrets.AWS_SECRET_KEY }} |
vars |
Non-sensitive configuration variables from settings | ${{ vars.TARGET_ENV }} |
runner |
os, arch, temp, tool_cache |
key: ${{ runner.os }}-npm-... |
job |
status (success/failure/cancelled) |
if: job.status == 'failure' |
steps |
steps.<id>.outputs, steps.<id>.outcome |
${{ steps.build.outputs.version }} |
needs |
needs.<job>.result, needs.<job>.outputs |
${{ needs.build.outputs.artifact-name }} |
matrix |
Current matrix variables for this job instance | ${{ matrix.node }} |
inputs |
Inputs passed via workflow_dispatch or workflow_call |
${{ inputs.environment }} |
Context availability varies by event. For example, github.event.pull_request is only populated on pull_request events, and needs is only available in jobs that declare needs:. Referencing an undefined context key returns an empty string rather than an error.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
