ubuntu-latest.


- No source control is configured (it was run manually in Jenkins).
- No automated triggers (built manually).
- No environment variables defined.
- Several shell build steps that run sequentially on one build node.

- Calls the adviceslip API to fetch a piece of advice.
- Validates the advice contains more than five words.
- Installs
cowsayand prints the advice as ASCII art.
- Jenkins freestyle -> GitHub Actions single job.
- Keep the same shell flow, but place it in one multi-line
runstep. - Use
workflow_dispatchto allow manual triggering from the Actions UI. - Install required packages (
jq,cowsay) on the runner before use.
.github/workflows/generate-ascii.yaml with workflow_dispatch so it can be triggered manually. Here is a concise, robust workflow that reproduces the Jenkins behavior:
Best practice: Put package installation at the top of your step so required tools are available before they are referenced. If you need persistent environment variables or secrets, declare them at the workflow or job level using
env: or GitHub Secrets.
Open the Actions tab in your repository and trigger the workflow manually. The job log will show output for each command just like Jenkins.

- The adviceslip JSON and the validation success message:
- Installation output and the generated ASCII artwork:
Note: When a script exits with a non-zero status, GitHub Actions marks the step and job as failed. Design your exit codes intentionally if you rely on failure vs. success conditions for downstream steps or notifications.
- GitHub Actions documentation: https://docs.github.com/actions
- Upload artifact action: https://github.com/actions/upload-artifact
- Download artifact action: https://github.com/actions/download-artifact
- adviceslip API: https://api.adviceslip.com/
- If you need to preserve job-level environment variables, add
env:at the workflow or job level. - To split work into stages, convert sequential shell steps into separate jobs and use
needs:to express dependencies. - A follow-up lesson will cover converting a multi-stage Jenkins pipeline into a multi-job GitHub Actions workflow.