workflow_dispatch.

Greet, Build, and Result. Each job will run on an ubuntu-latest runner. By default GitHub Actions runs jobs in parallel; to preserve sequential behavior use the needs keyword to declare dependencies.
Job mapping (Jenkins stage → GitHub Actions job):
| Jenkins Stage | GitHub Actions Job | Purpose |
|---|---|---|
Greet | Greet | Print greeting message |
Build | Build | Simulate a build step (sleep) |
Results | Result | Emit completion timestamp |
.github/workflows/scripted-pipeline.yml:
Quick tips:
- YAML comments use
#.//is NOT valid YAML and will break the workflow. - When using
sleepin a shell step prefer an explicit time unit like5sfor portability. - Use
needsto control job ordering; omit it to allow jobs to run in parallel.
Greet and Build to run in parallel (and still have Result run after Build), remove the needs: Greet line from the Build job:
- With
needschaining (Greet → Build → Result), jobs execute serially; the total workflow time includes runner startup + each job’s runtime. - Allowing parallel jobs can reduce wall-clock time but consumes more concurrent runners.
- If you want to avoid multiple runner spin-ups, combine multiple stages into a single job (multiple
steps) to reuse the same runner instance.

- Greet job:
- Build job:
- Result job:
- Convert Jenkins stages into GitHub Actions jobs and use
needsto preserve sequencing. - Omit
needsto allow parallel execution where appropriate. - Validate YAML syntax (
#comments) and shell step behavior (explicitsleepunits). - For further optimization, consider merging stages into a single job to reduce runner provisioning time.