Interview Prep/GitHub Actions/Jobs, Steps, Matrix & Concurrency

What happens when you re-run a workflow: which attempts, tokens and code are used?

IntermediateConceptJobs, Steps, Matrix & Concurrency
Answer

A re-run creates a new attempt (github.run_attempt increments) of the same run, using the same commit SHA and the same workflow file version, and the original event payload. New GITHUB_TOKENs are minted. "Re-run failed jobs" re-runs failed jobs and their dependents only, reusing outputs from successful jobs. Environment approvals are required again. Secrets are read fresh, so a rotated secret takes effect on re-run, but a fixed workflow file does not: push a new commit for that.

All GitHub Actions questions Roadmap: GitHub Actions

More on Jobs, Steps, Matrix & Concurrency