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.
permissions scopes GITHUB_TOKEN authority. When you specify individual permissions, omitted permissions are set to none; repository/org policies can further constrain the result.
Fragment
Top-level workflow permission block. Some jobs may need explicitly reviewed additional permissions.
Read a configured secret through its supported context into an environment value. Missing secrets can resolve to empty strings. Masking is not a complete data-loss prevention boundary.
Fragment
Steps-list fragment. Configure API_TOKEN outside this file; the command checks presence without printing the value.
Untrusted event fields can become script injection if interpolated directly into run source. Pass values as environment data and quote their use; validate them for the operation you perform.
Fragment
Steps-list fragment for a pull_request job using Bash. This demonstrates a length check without interpreting the title as shell code.
Fork pull_request workflows normally have restricted tokens/secrets, subject to repository policy. pull_request_target uses the base-repository context; do not combine its privileges with executing untrusted pull-request code.
Protocol / decision sketch
Trust-boundary sketch; inspect actual repository/org settings, runner trust and event semantics.
A full commit SHA fixes the referenced action revision; a moving major tag can change. Review the publisher and code, and maintain updates rather than assuming a pin remains secure forever.
Fragment
Steps-list fragment; pin resolution is recorded in the reference metadata and should be re-reviewed over time.
.github/workflows/checks.yml
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
# Step fragment, official checkout v7.0.1 tag resolved 2026-11-07:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: persist-credentials: false
id-token:write permits requesting an OIDC token; it does not itself grant cloud-resource access. Configure the provider to validate intended issuer, audience and repository/ref/environment claims.
Fragment
Workflow permission fragment. A provider-specific, reviewed exchange step and trust policy are still required.