How do you test a GitHub Actions workflow change before merging?
BeginnerProductionGitHub Actions and GitLab CI in Production
Answer
Lint with actionlint, run on a branch (a push to a branch containing the workflow changes triggers it, and workflow_dispatch allows manual runs from that branch), use act for quick local runs of simple jobs, and for reusable workflows reference the branch ref (@my-branch) from a test repo. For deploy workflows, first point them at a sandbox environment.
More on GitHub Actions and GitLab CI in Production
How do you organise reusable workflows for an organisation on GitHub?IntermediateHow do you reduce GitHub Actions minutes cost on private repos?IntermediateHow do you secure self-hosted runners?AdvancedHow do you design the GitHub Actions OIDC trust policy for AWS safely?AdvancedHow do you handle approvals and deployments across environments in GitHub Actions?IntermediateHow do you handle required checks when workflows use path filters or matrices?Advanced