Sign inSign up free

797. Cancel Outdated CI Runs

medium 20 XP ~8 minHands-on lab

On storefront, developers push to their pull requests several times in a row, and each push starts a 20-minute CI run of .github/workflows/ci.yml (in /home/student/repos/storefront). Old runs keep going even though nobody needs their result.

Task

Add a workflow-level concurrency setting to ci.yml so that:

  • runs are grouped per workflow and branch/PR ref (use github.workflow and github.ref in the group name),
  • a new run for a pull request cancels the run still in progress for the same pull request,
  • runs on main are never cancelled (they queue instead), because every commit on main must be built.

Keep the triggers and jobs as they are.

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: A Manual Deploy Button With Inputs

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.