/101-first-workflow

Introduction to GitHub Actions @ Open Source 101: Columbia

Primary LanguageHTML

Open Source 101: First Workflow

🎯 Goal

Show GitHub Actions...in action 😉

💻 Steps

1. Use GitHub Actions to lint code using standard.

Solution
# lint.yml
# This is a YAML file. Quickstart: https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes

# Name of workflow (optional)
name: Lint

# Event that triggers the workflow (eg. push, issues, pull_request)
on: [push]

# List of jobs, which run in parallel on different VMs
jobs:
  # Can be named whatever you'd like
  lint:
    # Which kind of runner to fetch
    runs-on: ubuntu-latest

    # List of steps, which run sequentially on the same VM
    steps:
    - id: checkout
      name: Checkout
      uses: actions/checkout@v2 # this uses the action at https://github.com/actions/checkout
      
    - id: standard
      name: Standard
      run: npx standard # this runs a shell command (bash is default)

2. Become familiar with terminology and resources.