On September 1, 2022, GitHub Learning Lab will shut down.
Read more on the GitHub blog and check out GitHub Skills for courses backed by GitHub Actions.

Building: The before block

GitHub Learning Lab is no longer accepting new public courses from outside of GitHub.

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

The before block in config.yml is optional. It defines a series of actions. These actions execute after Learning Lab creates a copy of the template for the learner, but before the user is expected to complete steps.

Usage examples

Here are some common uses for the before block.

  • seed the learner's repository with an issue and store the issue url for later
    - type: createIssue
      title: Getting Started with GitHub
      body: introduction.md
        first_issue_url: '{{ result.data.html_url }}'
  • set up branch protections
    - type: updateBranchProtection
  • complete multiple setup steps, like creating multiple pull requests
      - type: updateBranchProtection
      - type: createPullRequest
        title: "Welcome! Let's resolve a conflict"
        body: 00_welcome-conflict-1.md
        head: update-config
      - type: createPullRequest
        title: Another User's Change
        body: 00_another-user-conflict-6.md
        head: education-conflict
          education_conflict_pr: '{{ result.data.html_url }}'
      - 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