StaffCoder
GitHub Actions
8 modules · 24 challengesSign up
Module 7 of 8 · 3 challenges

GitHub Actions Reusable Workflows & Custom Actions

Factor a pipeline into reusable parts: a composite action with inputs and outputs, and a called workflow with a typed contract.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

3 challenges

Composite Setup Action

Sign up to unlock
—No data yetmedium
About this challenge

Two workflows carry drifting copies of the same toolchain setup. Extract it into one local composite action with a defaulted input, a required input and an output the calling step reads back, and have both workflows call it with uses: ./. The shipped tool records the directory it ran from, which is the action's own directory inside a composite and empty in an inline step, so repeating the steps in each workflow does not pass.

Solved in a browser IDE and graded by tests. Sign up to solve

Reusable Workflow Contract

Sign up to unlock
—No data yetmedium
About this challenge

Four drifting per-service pipelines become one reusable workflow with a workflow_call contract: a required string input, a defaulted number input, a required secret and an output that reaches the caller's summary job through needs. The shipped tool records which workflow it ran in, which inside a called workflow is the called workflow's name and not the caller's, so leaving the steps in the caller does not pass. One grading run withholds the signing secret to prove the packaging depends on it.

Solved in a browser IDE and graded by tests. Sign up to solve

Shared CI Library

STAR
Solving it completes the module
—No data yetmedium
About this challenge

Assemble the library: one composite setup action, one reusable test-and-package workflow that calls it, and one caller invoking that workflow per service with explicit secrets, with both outputs feeding a summary job. The shipped tools record where they ran - the action's own directory inside a composite, and the called workflow's name inside a reusable workflow - so leaving either inline does not pass however identical the files. One grading run withholds a single service's secret to check the failure stays with that service.

Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.