github.event_name# push, pull_request, schedule, etc.github.ref# refs/heads/main, refs/tags/v1.0github.ref_name# main, v1.0 (short ref)github.sha# Full commit SHAgithub.actor# User who triggered the workflowgithub.repository# owner/repogithub.repository_owner# Organization or usergithub.workspace# Runner workspace pathgithub.run_id# Unique run identifiergithub.run_number# Sequential run numbergithub.event# Full event payload (JSON)github.token# GITHUB_TOKENgithub.base_ref# Base branch for PRsgithub.head_ref# Head branch for PRs
- Secrets are masked in logs (replaced with ***) - Cannot be used in if conditions directly - Not available in reusable workflows unless explicitly passed or inherited
steps.step-id.outputs.name# Output from a previous stepsteps.step-id.outcome# success, failure, cancelled, skippedsteps.step-id.conclusion# Same as outcome but respects continue-on-error
# Only on push to mainif:github.event_name == 'push' && github.ref == 'refs/heads/main'# Only on PRsif:github.event_name == 'pull_request'# Skip for bot usersif:github.actor != 'dependabot[bot]'# Run on failure to send notificationsif:failure()# Check a step outputif:steps.check.outputs.changed == 'true'# Contains checkif:contains(github.event.pull_request.labels.*.name, 'deploy')# Starts with checkif:startsWith(github.ref, 'refs/tags/v')