How do you trigger a workflow on push and pull request?
Use the `on` key to declare event triggers and branch filters. Keep required PR checks available for the branches protected by repository rules.
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 1681–1692 of 3610 questions
Use the `on` key to declare event triggers and branch filters. Keep required PR checks available for the branches protected by repository rules.
Caching reuses dependency downloads or build data between runs. Use a cache key that changes when lockfiles or relevant tool versions change; cac…
Store credentials in GitHub Actions secrets or environment secrets, scope access narrowly, and avoid printing them. Prefer short-lived federated…
A workflow should receive only the permissions and credentials needed for its task. Set minimal `GITHUB_TOKEN` permissions, separate deployment e…
A matrix strategy runs the same job across combinations such as operating systems, runtime versions, or dependency versions. Use it for compatibi…
Jobs usually run on separate runner instances. Upload build outputs as artifacts in one job and download them in another, or publish immutable ar…
Run tests as an explicit pipeline gate and return a failing exit code when a test fails. Include fast unit tests on each PR, and run slower integ…
The testing pyramid recommends many fast unit tests, fewer integration tests, and a smaller number of end-to-end tests. The mix depends on the sy…
Linting flags suspicious patterns and style issues; formatting applies consistent layout; static analysis checks code properties without executin…
Flaky tests pass and fail without relevant code changes, often due to timing, shared state, random data, or external dependencies. Make tests det…
Coverage measures which code was executed by tests, commonly line, branch, or function coverage. High coverage does not prove assertions are corr…
Treat migrations as versioned artifacts, test them against representative schemas/data, and plan for compatibility between old and new applicatio…