Compare GitHub Actions and GitLab CI syntax for checks, artifacts, permissions and release controls.
Scope and conventions
GitHub Actions (hosted Ubuntu) and GitLab CI. Rows are independent; fragments need the stated placement and prerequisites. npm examples need package-lock.json and a test script. Pins checked 7 November 2026: checkout v7.0.1, setup-node v7.1.0, upload-artifact v7.0.2, download-artifact v8.0.2. Runner, permission and approval requirements are named; review pins for updates.
A workflow file declares triggers and a job. Checkout and runtime setup precede project commands; this runs the repository’s existing npm test script, not an unspecified built-in test suite.
Complete file
Complete workflow file for the existing npm project described above. GitHub-hosted runner assumed; SHA pins should be reviewed for updates.
push branch filters and pull_request branch filters select different events; pull_request branches refer to the target branch. Configure both only when both checks are wanted.
Fragment
GitHub Actions YAML fragment; place it at the scope shown. Referenced project commands/files must exist.
.github/workflows/checks.yml
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
on: push: branches: [main] pull_request: branches: [main]
runs-on chooses a runner. A job container is a separate choice with its own available tools and shell behavior; a runner label is not an arbitrary container image.
Fragment
GitHub Actions YAML fragment; place it at the scope shown. Referenced project commands/files must exist.