Building: The before block

The before block in config.yml is optional, and defines a series of actions that will be executed after Learning Lab creates a copy of the template for the learner, but before the user is expected to complete steps

GitHub Learning Lab's mascot A course on GitHub Learning Lab can guide you through this step.

Usage examples

Here are some common uses for the before block.

  • seed the learner's repository with an issue
    before:
    - type: createIssue
      title: Getting Started with GitHub
      body: introduction.md
  • set up branch protections
    before:
    - type: updateBranchProtection
  • complete multiple setup steps, like creating multiple pull requests
    before:
      - type: updateBranchProtection
      - type: createPullRequest
        title: "Welcome! Let's resolve a conflict"
        body: 00_welcome-conflict-1.md
        head: update-config
        data:
          thePayload: '%payload%'
      - type: createPullRequest
        title: Another User's Change
        body: 00_another-user-conflict-6.md
        head: education-conflict
        action_id: another_users_pr
      - type: createPullRequest
        title: More conflicts
        body: 00_more-conflicts-3.md
        head: add-experience
      - type: createPullRequest
        title: Create your own conflict
        body: 00_create-conflict-5.md
        head: add-education