Recap: Weekend Out Exercise#

Let’s revisit last week’s Weekend Out exercise to deepen our understanding of GitHub workflows in practice.

What Actually Happened?#

Think back to the exercise where multiple people (you, Alice, Bob, and Carol) were collaborating on a packing list. Some unexpected things happened automatically - let’s understand why!

Key Questions
  • What exactly was going on in the Weekend-Out repository?

  • How did a merge conflict occur automatically?

  • What triggered the workflows?

  • Who (or what) made commits as “Carol[bot]” and “Alice[bot]”?

  • Why did two drone lists end up in the main branch?

Hint

Take another look at the .github/workflows/ directory in the Weekend-Out repository.

Three workflow files were silently working in the background:

  • auto-commit-blanket.yml

  • carols_drone_and_alice.yml

  • carols_issue.yml


Understanding the Chaos#

The Merge Conflict
  1. You create feature/essentials branch

  2. Workflow 1 immediately commits to main (adds “extrawarm blanket”)

  3. You locally add blankets to the feature branch

  4. When you merge: conflict! (same line modified in both places)

The Duplicate Lists
  1. You create an issue with ‘restruct’ in title

  2. You create a PR from a branch with ‘restruct’ in name

  3. Workflow 2 triggers and commits Carols_drone_list.md to main

  4. You also create a drone list and merge your PR

  5. Result: Two drone lists in main!


Key Takeaways#

Workflows Run Independently

Workflows are triggered by events, not by human intention. They run automatically and can make changes to your repository without your direct involvement.

Branch Protection Matters

Allowing direct commits to main (as these workflows do) can lead to conflicts and unexpected state. Branch protection rules help prevent this.

Always Pull Before Push

The workflows committed to main while you were working. Always pull the latest changes before merging to avoid conflicts.

Coordination is Critical

In a real team, workflows should be documented and coordinated. The “chaos” was intentional for learning, but in production, workflows should be predictable.


Reflection Questions#

Before we move on to GitLab pipelines, consider:

  1. Event-Driven Architecture: How do the on: triggers demonstrate event-driven automation?

  2. Conditional Execution: How do the if: conditions control when jobs run?

  3. Context Access: How do workflows access repository information (github.ref, github.head_ref, github.event)?

  4. Permissions: What permissions did these workflows need and why?

  5. Bot Commits: How did the workflows impersonate users (Carol[bot], Alice[bot])?

  6. Real-World Application: How would you use similar patterns (without the chaos) in a real project?