Sign inSign up free

799. Pass a Version Between Jobs

medium 20 XP ~10 minHands-on lab

In /home/student/repos/storefront/.github/workflows/release.yml, the jobs build and publish each recompute the version with ./scripts/version.sh, and twice they disagreed (one ran a minute later, after a new tag).

Task

Add a job version that runs ./scripts/version.sh once and exposes the result as the job output version. Then:

  • build and publish both need version and use needs.version.outputs.version instead of running the script themselves,
  • in build, the version is passed to make build as the environment variable VERSION,
  • in publish, the image tag is registry.example.com/storefront:<version>.

The step in version must write the value with the $GITHUB_OUTPUT file (not the deprecated set-output command).

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Part of CI/CD Pipelines in Practice. Next step: An Experimental Matrix Entry That May Fail

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.