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 job/step if expression is evaluated by Actions, while a shell conditional runs on the runner. Do not paste expression data into shell source to decide what to execute.
Fragment
GitHub Actions YAML fragment; place it at the scope shown. Referenced project commands/files must exist.
A matrix creates job variants. The runtime is selected by setup-node using the matrix value; merely declaring a node dimension does not change the installed runtime.
Fragment
GitHub Actions YAML fragment; place it at the scope shown. Referenced project commands/files must exist.
A nonzero command status fails a run step under the configured shell behavior. continue-on-error changes failure handling; it is not a repair for an unreliable mandatory check.
Fragment
GitHub Actions YAML fragment; place it at the scope shown. Referenced project commands/files must exist.
A cleanup step with always() can run after earlier steps fail, but infrastructure loss, termination and time limits can still prevent completion. External resources need a recovery/expiry policy.
Fragment
GitHub Actions YAML fragment; place it at the scope shown. Referenced project commands/files must exist.