Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Testtimescaling Testtimescaling github io Welcome Branch Setup

From Leeroopedia


Knowledge Sources
Domains Education, CI_CD, Version_Control
Last Updated 2026-02-14 00:00 GMT

Overview

GitHub Actions workflow that bootstraps the course learning environment by creating a feature branch, generating starter files, and advancing the step tracker from 0 to 1.

Description

This workflow (Template:Code) is a Wrapper Doc that orchestrates three components: Template:Code for repository access, inline shell commands for branch and file creation, and Template:Code for step state management. It triggers on the initial push to main after a learner creates a repository from the course template.

The workflow contains two jobs:

  1. get_current_step -- reads Template:Code and exposes the value as a job output
  2. on_start -- guarded by the step check and template check, performs all scaffolding work

The on_start job executes three sequential steps:

  1. Checkout the repository with full history (Template:Code)
  2. Run a shell script that creates the Template:Code branch, generates Template:Code and Template:Code, commits with the Template:Code identity, and pushes the branch
  3. Invoke Template:Code to advance from step 0 to step 1

Usage

This workflow runs automatically when:

  • A learner creates a new repository from the course template (triggers Template:Code to main)
  • A maintainer manually triggers the workflow via Template:Code

No manual configuration is required. The workflow is self-contained and idempotent.

Code Reference

Source Location

  • Repository: Testtimescaling/Testtimescaling.github.io
  • File: Template:Code
  • Lines: 1-94

Signature

name: Step 0, Welcome

on:
  workflow_dispatch:
  push:
    branches:
      - main

permissions:
  contents: write
  pull-requests: write

jobs:
  get_current_step:
    name: Check current step number
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - id: get_step
        run: |
          echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
    outputs:
      current_step: ${{ steps.get_step.outputs.current_step }}

  on_start:
    name: On start
    needs: get_current_step
    if: >-
      ${{ !github.event.repository.is_template
          && needs.get_current_step.outputs.current_step == 0 }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Create my-pages branch, initial Pages files, and pull request
        run: |
          echo "Make sure we are on step 0"
          if [ "$(cat .github/steps/-step.txt)" != 0 ]
          then
            echo "Current step is not 0"
            exit 0
          fi
          echo "Make a branch"
          BRANCH=my-pages
          git checkout -b $BRANCH
          echo "Create config and homepage files"
          touch _config.yml
          printf "%s\n%s\n%s\n\n" "---" "title: Welcome to my blog" "---" > index.md
          echo "Make a commit"
          git config user.name github-actions[bot]
          git config user.email github-actions[bot]@users.noreply.github.com
          git add _config.yml index.md
          git commit --message="Create config and homepages files"
          echo "Push"
          git push --set-upstream origin $BRANCH
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Update to step 1
        uses: skills/action-update-step@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          from_step: 0
          to_step: 1
          branch_name: my-pages

Import

# This workflow is defined in the repository and runs automatically.
# No import is needed. The external actions are referenced via `uses:`:
#   - actions/checkout@v4
#   - skills/action-update-step@v2

I/O Contract

Inputs

Name Type Required Description
Push event to main GitHub event Yes The trigger that starts the workflow; occurs automatically when a repository is created from the template
.github/steps/-step.txt File (integer) Yes Must contain Template:Code for the workflow to proceed past the guard condition
secrets.GITHUB_TOKEN Token Yes Automatically provided by GitHub Actions; used for git push and step update authentication

Outputs

Name Type Description
my-pages branch Git branch New branch created from main, containing the starter files
_config.yml File Empty Jekyll configuration file on the my-pages branch
index.md File Starter homepage with YAML front matter (Template:Code)
.github/steps/-step.txt File (integer) Updated from Template:Code to Template:Code
README.md File Replaced with step 1 instructions by the action-update-step action

Usage Examples

Example: Automatic Trigger on Repository Creation

1. Learner navigates to the template repository on GitHub
2. Clicks "Use this template" → "Create a new repository"
3. GitHub creates the new repository and pushes template contents to main
4. The push event triggers the 0-welcome.yml workflow
5. Workflow creates my-pages branch with _config.yml and index.md
6. Workflow advances step from 0 to 1
7. README.md is updated with step 1 instructions ("Enable GitHub Pages")

Example: Manual Re-trigger via workflow_dispatch

# If step 0 did not complete (e.g., transient failure), re-run manually:
gh workflow run "Step 0, Welcome" --repo <owner>/<repo>

# This only works if .github/steps/-step.txt still contains 0.
# If the step has already advanced, the guard condition prevents re-execution.

Example: Generated index.md Content

---
title: Welcome to my blog
---

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment