GitHub Actions Workshop

Master GitHub Actions with hands-on labs and exercises. Learn how to automate workflows, run tests, deploy applications, and more using GitHub's powerful automation platform. This repository has everything you need to get started with continuous integration and continuous deployment.


Project maintained by prasadhonrao Hosted on GitHub Pages — Theme by mattgraham

Solution: Environment Variable Scope

name: Env Var Scope

on:
  workflow_dispatch:
  push:
    paths:
      - '.github/workflows/env-var-scope.yml'

env:
  WORKFLOW_ENV_VAR: 'Workflow Environment Variable'

jobs:
  print:
    runs-on: ubuntu-latest

    env:
      JOB_ENV_VAR: 'Job Environment Variable'

    steps:
      - name: Display Environment Variables
        env:
          STEP_ENV_VAR: 'Step Environment Variable'
        run: |
          echo "WORKFLOW_ENV_VAR: $WORKFLOW_ENV_VAR"
          echo "JOB_ENV_VAR: $JOB_ENV_VAR"
          echo "STEP_ENV_VAR: $STEP_ENV_VAR"