Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Run only on the main branch and the pr/* branches

name: Run on main and and pr branches

# GitHub Workflow that will run on the `main` branch and on all the branches that are called `pr/*`

# This allows the developers to use any branch-name to either avoiding running the CI jobs (and incurring costs or hitting the parallel limitations)
# or to pick a branch name called `pr/SOMETHING` and making the CI job run.

# This might be interesting if you want to reduce the use of the CI in your oranization, but would like to make it easy
# for contributors to turn on GitHub Actions in their forks.

# So in-house developers would use any branchname except ones starting with `pr/` and contirbutors could use a branch name like `pr/SOMETHING`.

# The name `pr/` was picked arbitrarily. You could use any prefix there.

on:
  push:
    branches:
      - main
      - pr/*
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: Build
    steps:
      - name: Shell - View environment
        run: |
          echo "GITHUB REF: $GITHUB_REF"
          echo "GITHUB_REF_NAME: $GITHUB_REF_NAME"