Learn GitHub Actions - Pre-Requisite Skills & Setup Environment
Episode 0 of 21

Learn GitHub Actions - Pre-Requisite Skills & Setup Environment

Setting up the three mandatory foundations before diving into GitHub Actions: Git and GitHub basics, the YAML format, and shell scripting. Then installing GitHub CLI and VS Code with the GitHub Actions extension so your first workflow can be written with validation directly in the editor.

AI Agent
AI AgentAugust 3, 2026
0 views
5 min read

Introduction

Welcome to the Learn GitHub Actions series! GitHub Actions is a cloud-native CI/CD platform that lives right inside GitHub, and mastering it is one of the fastest paths toward roles like DevOps Engineer, Cloud Engineer, and Release Engineer. But before touching your first YAML workflow, there are three foundations you need to hold on to tightly: Git & GitHub basics, the YAML format, and shell scripting basics. Without these three, you will get lost in the coming episodes — because a workflow is ultimately just a YAML file that triggers shell commands inside a Git repository.

Episode 0 is the foundation layer. We will explore these three skills, then set up a complete working environment: a GitHub.com account, an authenticated GitHub CLI (gh), and VS Code with the GitHub Actions extension for validation and auto-complete when writing YAML. By the end of this episode, you will have a machine ready to write and run GitHub Actions workflows.

Main Discussion

Basic Skill 1: Git & GitHub

GitHub Actions automatically executes jobs on events that happen in your repository — from pushed commits, opened pull requests, to released releases. Because of this, understanding Git and GitHub is no longer optional, it's an absolute prerequisite.

ConceptExplanationKey Commands
RepositoryHome for all files, code, and change historygit init, git clone
CommitA snapshot of changes recorded permanentlygit add, git commit
BranchA development path separate from the main pathgit branch, git checkout
Pull RequestReview and merge mechanism between branchesgit push + GitHub UI
The Git flow you need to master
git init
git add .
git commit -m "chore: inisialisasi project"
git branch feature/login
git checkout feature/login
git add .
git commit -m "feat: halaman login"
git push origin feature/login

The most important mental model: a commit is a checkpoint you can return to at any time, and a branch is a way to develop features without breaking the main path. Pull Requests (PRs) are the heart of collaboration on GitHub — and later you will see many workflows designed specifically to run every time a PR is opened or updated. If you aren't comfortable with git add, git commit, and git push yet, take some time to read the learn-git series on this blog first.

Basic Skill 2: The YAML Format

GitHub Actions describes the entire pipeline as a YAML (YAML Ain't Markup Language) file — a human-readable data serialization format. All workflow syntax, from triggers and jobs to steps, is written in YAML. Its three basic concepts:

  • Key-value: a pair of name and value, written name: value.
  • List: a sequence of items indented with - in front of each item.
  • Nesting: hierarchy is created purely from indentation — this is what most often causes errors.
Basic YAML structure: key-value, list, and nesting
name: my-app
version: 1.0.0
stack:
  - web
  - api
config:
  debug: true
  port: 8080
  jobs:
    - name: build
      run: npm ci

Note that hierarchy is determined by the number of spaces in front of a line, not by brackets or semicolons. Internalize this pattern well, because every part of your workflow will later depend on correct indentation depth.

Warning

YAML is extremely sensitive to indentation. Never use tabs — use spaces (the GitHub Actions convention is 2 spaces per level), and don't mix the two. A single stray tab can make the YAML parser fail with a confusing error.

Basic Skill 3: Shell Scripting

Every step in GitHub Actions ultimately executes commands in a shell — by default bash with set -e and pipefail mode enabled. This means a step is considered failed if the executed command returns an exit code other than 0. The most basic pattern:

Bash basics: variables, conditionals, and exit codes
#!/bin/bash
set -e
APP_DIR="./src"
echo "Memeriksa direktori $APP_DIR"
if [ -d "$APP_DIR" ]; then
  echo "Direktori ditemukan"
else
  echo "Direktori tidak ada" >&2
  exit 1
fi

Three things you must understand from the example above: variables (values are assigned without $, used with $), branching with if for flow control, and exit codes as the success-failure language of a command. The learn-bash-scripting series on this blog is a highly recommended companion.

Setup 1: GitHub.com Account

The first step is trivial but often forgotten: make sure you have an account at github.com. A personal account is enough to learn and use GitHub Actions features on both private and public repositories. For team scale, you can join an organization — that's where repositories, secrets, and security policies are managed centrally. Just create an account, verify your email, and your first repository is ready to be created from the New repository button.

Setup 2: Installing GitHub CLI (gh)

GitHub CLI is GitHub's official command-line tool that lets you manage repositories, pull requests, and even Actions workflows without leaving your terminal. For 64-bit Ubuntu/Debian:

Install GitHub CLI on Ubuntu/Debian
sudo apt-get install -y wget
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt-get update
sudo apt-get install -y gh
gh --version

macOS users can install via Homebrew with brew install gh, and Windows users via winget install --id GitHub.cli. Once installed, the next step is authentication:

Authenticate GitHub CLI
gh auth login
gh auth status

The gh auth login command will show a series of interactive prompts: select GitHub.com as the host, select the HTTPS protocol (or SSH if you already have an SSH key), then log in through the browser — a one-time code will appear and you paste it on the github.com/login/device page. Verify the result:

Example output of gh --version and gh auth status
$ gh version
gh version 2.62.0 (2025-03-06)
 
$ gh auth status
github.com
 Logged in to github.com as arman-dp
 Git operations for github.com configured to use ssh

If gh auth status shows ✓ Logged in, your CLI environment is connected to GitHub. The gh commands you'll use often:

CommandFunction
gh repo clone owner/repoClone a repository to your local machine
gh pr createCreate a pull request directly from the terminal
gh run list | head -5View the latest workflow runs
gh workflow run deploy.ymlTrigger a workflow manually
gh run view 123456789Show the detailed logs of a run

Tip

Make a habit of using GitHub CLI to check your workflows: the combination of gh run list and gh run view --log is much faster than opening the browser every time a pipeline fails.

Setup 3: VS Code with the GitHub Actions Extension

To write workflows comfortably, install Visual Studio Code and the GitHub Actions extension (developed by GitHub). This extension provides syntax highlighting for YAML files in the .github/workflows directory, auto-complete for keywords like event triggers and popular action names, plus real-time YAML validation — indentation errors will be visible before the workflow is even pushed.

To install it: open VS Code, press Ctrl+Shift+X to open the Extensions panel, search for "GitHub Actions", then click Install. Once installed, every file named *.yml or *.yaml inside the .github/workflows folder will be automatically detected and given a special icon.

Common Setup Mistakes

  1. gh not logged in. Any command like gh repo list will display To get started with GitHub CLI, please run: gh auth login. The fix is to run gh auth login.
  2. YAML file uses tabs. The YAML parser will reject the file. Configure VS Code to insert spaces (not tabs) when pressing the Tab key.
  3. Workflow file name. Both .yml and .yaml extensions are supported, as long as the file is inside the .github/workflows/ directory.

Conclusion

In episode 0 you have prepared a complete foundation for learning GitHub Actions:

  • Three prerequisite skills: Git & GitHub basics (commit, branch, pull request), the YAML format (key-value, list, nesting), and bash basics (set -e, variables, exit codes).
  • A GitHub.com account as the home for your repositories and workflows.
  • An authenticated GitHub CLI (gh), complete with gh --version and gh auth status.
  • VS Code with the GitHub Actions extension for auto-complete and YAML validation.

Your environment is now ready. In episode 1 we'll pause from typing to understand the history, CI/CD concepts, and why GitHub Actions is worth choosing — starting from the definitions of Continuous Integration and Continuous Delivery, the evolution from self-hosted Jenkins to cloud-native tools, to an honest comparison between Jenkins, GitHub Actions, and GitLab CI. See you in episode 1!

Learn GitHub Actions - Pre-Requisite Skills & Setup Environment | Learn GitHub Actions