00 · The starting point

Every later step changes one small repository. Get its starting files into a repository of your own, and see what it holds before Redline arrives.

About 5 minutesNeeds GitHubFiles after this step ↗

✓

You will learn

  • What the demo service is, and what its CI checks before Redline
  • How to get the starter files: downloaded, or built by hand file by file
  • How to put them in a GitHub repository of your own

Before you start

  • git
  • Node 18.11 or later
  • pnpm. If you build the files by hand, npm, yarn or bun work too.
  • A GitHub account, and the GitHub CLI signed in with gh auth login

Get the starter files

Step 00 is a small TypeScript service with two tests and a CI workflow, and nothing from Redline yet. Download it in one go, or build it yourself file by file and see what each piece is for.

Open step 00 on GitHubDownload .zip

ℹ

step-00 is a tag, not a branch. Searching the branch list on GitHub finds nothing; open the Tags tab in the same menu, or use the link above.

Or, in an empty folder, unpack it straight into a repository of your own. Skip git init if you have already run it. git branch -M main names the branch main, whatever git called it: every later step, and the rules Redline puts on the branch, use that name.

terminal
$ git init
$ curl -L https://github.com/moelzanaty3/redline-demo/archive/refs/tags/step-00.tar.gz | tar -xz --strip-components=1
$ git add -A
$ git commit -m "chore: start from the Redline demo, step 00"
$ git branch -M main
$ pnpm install
$ pnpm test

ℹ pass 2
ℹ fail 0

That copies the files, not the demo's history: the repository is yours alone, with nothing connecting it to the demo. The download comes set up for pnpm; to use another package manager, build it by hand.

pnpm: command not found? Install it with npm install -g pnpm.

You don't install Redline yet. Step 01 runs it once, and it adds itself to your project as a pinned dev dependency, so everyone on the repository runs the same version.

Put your repository on GitHub

The checks Redline adds run on pull requests, so your repository needs to be on GitHub. From its root:

terminal
$ gh repo create my-redline-demo --public --source . --remote origin --push

That creates a new public repository under your own account and pushes your main to it. Everything from here on happens there; the demo is only ever read from.

Why public: GitHub gives a public repository dependency review and secret scanning for free, and the gate uses both from step 01 on.

To check it worked, open the repository in your browser and look at its Actions tab. The CI workflow ran on the push to main, and it is green:

terminal
$ gh repo view --web
Private repository Must it be public?

No, and most real repositories are private. On a private repository, dependency review and secret scanning are part of GitHub Advanced Security, which an organisation buys on a Team or Enterprise plan. Without it, the gate's dependency review goes red on your first pull request. Step 01 shows what that looks like and the two ways to answer it, and steps 06 and 07 say what changes for you. For this path, public is simpler: you can switch it to private, or delete it, when you are done.

ℹ

Already created the repository on GitHub? Skip the command above. Check git remote -v lists it as origin (if not, git remote add origin <its url>), then git push -u origin main. If GitHub added a README or licence when you created it, the push is refused; create it again empty.

What is in the repository

A small user directory, the kind of service a team writes in its first week:

PathWhat it is
src/users.tsA UserDirectory that adds and finds users
src/users.test.tsTwo tests, using Node's built-in test runner
tsconfig.jsonStrict TypeScript, including noUncheckedIndexedAccess
.github/workflows/ci.ymlInstalls the dependencies, compiles and runs the tests on every push and pull request

What nothing checks yet

CI compiles the code and runs the tests, and that is all. Nothing checks how the code is written: a @ts-ignore, a hardcoded token or a dependency with a known vulnerability would all pass, as long as the tests do. And nothing tells a coding assistant what this team expects, so it guesses. Step 01 fixes both with one command.

Check your understanding

In step 00, a pull request adds // @ts-ignore above a line that does not compile. What happens?