Why might `github.sha` in a PR workflow not match any commit you pushed?
IntermediateConceptContexts, Expressions, Env & Outputs
Answer
For pull_request, GitHub tests a synthetic merge commit of the PR head into the base (refs/pull/N/merge). Its SHA exists only on GitHub. Tagging images with github.sha in PRs therefore produces tags nobody can trace to a branch commit. Use github.event.pull_request.head.sha for traceable tags and status reporting, and keep the merge ref for testing (it catches semantic conflicts with main).
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