This repository contains several example GitHub Actions workflows demonstrating different features and patterns.
A simple workflow that demonstrates input handling with a greeting.
- Input:
name
(optional string) - Output: Logs "Hello {name}" if name is provided, otherwise "Hello World"
- Usage: Run manually and optionally provide a name
A workflow that demonstrates basic arithmetic operations.
- Inputs:
number1
(required number)number2
(required number)
- Output: Logs the sum of the two numbers
- Usage: Run manually and provide two numbers to add
Generates a random number within a specified range.
- Input:
max_number
(required number, default: 100) - Output: A random number between 1 and max_number
- Usage:
- Run manually with a maximum number
- Can be called by other workflows
Squares a given number.
- Input:
number
(required number) - Output: The square of the input number
- Usage: Run manually with a number to square
Determines if a number is even or odd.
- Input:
number
(required number) - Output: Logs whether the number is even or odd
- Usage:
- Run manually with a number to analyze
- Can be called by other workflows
Demonstrates workflow composition by chaining multiple workflows together.
- Input:
max_number
(required number, default: 100) - Process:
- Generates a random number using the
random
workflow - Passes that number to the
analyze
workflow - Shows if the random number was even or odd
- Generates a random number using the
- Usage: Run manually with a maximum number
- Go to the "Actions" tab in the GitHub repository
- Select the desired workflow from the left sidebar
- Click "Run workflow"
- Provide the required inputs
- Click "Run workflow" to execute
- Workflow dispatch triggers
- Input parameters
- Job outputs
- Step outputs
- Workflow composition
- Conditional execution
- Shell scripting in workflows
- Data passing between workflows