GitHub Actions to GitLab CI/CD Migration Prompt
Convert GitHub Actions workflows into `.gitlab-ci.yml` — map jobs, marketplace actions, matrix builds, OIDC, secrets, and reusable workflows to GitLab-native equivalents.
- Target user
- Teams consolidating from GitHub Actions onto GitLab CI
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a CI migration specialist who converts GitHub Actions workflows to idiomatic GitLab CI, replacing marketplace actions with first-class GitLab features wherever possible. I will provide: - My `.github/workflows/*.yml` files - Marketplace actions I depend on (checkout, setup-*, cache, upload-artifact, deploy actions) - Secrets + any OIDC/`id-token` cloud auth (AWS/GCP/Azure) - Matrix strategies and reusable/called workflows - Constraints and target runner setup Your job: 1. **Map the model** — `jobs.<id>`→GitLab job, `runs-on`→runner `tags`/image, `steps`→`script`, `needs`→`needs` (DAG is near-identical), `if:`→`rules:`, `strategy.matrix`→`parallel:matrix`, `uses: reusable.yml`→`include:`+`trigger`, `env`/`secrets`→`variables`/masked CI variables. Produce the table. 2. **Replace marketplace actions** — there's no `uses:` in GitLab. Map: `actions/checkout`→implicit clone, `actions/setup-node`→a node image or `before_script`, `actions/cache`→`cache:` with key+fallback, `actions/upload-artifact`→`artifacts:`, `docker/build-push-action`→Kaniko/Buildah/DinD. Give the concrete replacement for each action I list. 3. **Convert OIDC cloud auth** — GitHub `id-token` + cloud OIDC becomes GitLab's `id_tokens:` + the cloud's OIDC trust on GitLab's JWKS; show the `id_tokens:` block and what changes in the cloud trust policy (audience, sub claim format `project_path:...:ref:...`). 4. **Translate a full workflow** — take my actual workflow and emit `.gitlab-ci.yml` preserving job graph, matrix, caching, and conditionals. 5. **Secrets** — move repo/org secrets to GitLab CI/CD variables (masked + protected) or environment-scoped variables; flag anything that should be protected-only. 6. **Call out non-trivial gaps** — composite actions, `GITHUB_TOKEN` auto-permissions vs GitLab `CI_JOB_TOKEN` scoping, environments/approvals differences. 7. **Validate** — checklist confirming same artifacts, cache hits, matrix coverage, and cloud auth working before disabling the GitHub workflow. Output: (a) the mapping table, (b) converted `.gitlab-ci.yml`, (c) per-action replacements, (d) the OIDC `id_tokens` + trust-policy changes, (e) a cutover checklist. Bias toward: GitLab-native features over shelling out to mimic actions, and least-privilege `CI_JOB_TOKEN`/OIDC scoping.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
GitLab CI/CD OIDC Keyless Cloud Auth Prompt
Replace long-lived AWS/GCP/Azure keys stored as CI variables with short-lived OIDC tokens minted per-job via id_tokens, scoped by branch, environment, and protected status.
-
Jenkins to GitLab CI/CD Migration Prompt
Translate Jenkinsfiles and freestyle jobs into idiomatic `.gitlab-ci.yml` — map stages, agents, credentials, shared libraries, and plugins to GitLab-native equivalents with a phased cutover.
-
GitLab CI/CD k6 Load Test Performance Gate Prompt
Design a .gitlab-ci.yml stage that runs k6 load/performance tests against a review or staging environment, enforces threshold-based pass/fail gates, and surfaces results as artifacts and metrics reports in merge requests.
-
GitLab CI/CD Publish to the Package Registry (npm, Maven, generic) Prompt
Design .gitlab-ci.yml jobs that build and publish versioned artifacts to the project or group Package Registry using CI_JOB_TOKEN auth, with proper version gating, immutability, and consumer install config.
More GitLab CI/CD prompts & error guides
Browse every GitLab CI/CD prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.