title: GitHub Action - Define Workflow Level Environment Variable Between Jobs
body: <p>I'd like to define and set environment variable between jobs inside my Github Actions Workflow.
  The workflow below is what I've tried but unfortunately the environment variable <strong>GIT_PR_SHA_SHORT</strong> and <strong>E2E_GIT_PR_SHA</strong> not working.</p>
  <p>Is it possible?</p>
  <pre><code>name: Git Pull Request Workflow
  
  on:
    workflow_dispatch:
    pull_request:
      branches:
        - master
  
  env:
    GIT_PR_SHA: ${{github.event.pull_request.head.sha}}
    GIT_PR_SHA_SHORT: &quot;${{ env.GIT_PR_SHA:0:10 }}&quot;
    ENV_NAME: test
    E2E_GIT_PR_SHA: &quot;${{ env.ENV_NAME }}-${{ env.GIT_PR_SHA_SHORT }}&quot;
  
  jobs:
    first-job:
      name: Build Docker Image
      runs-on: ubuntu-latest
  
      steps:
      - name: First Echo Step
        run: |
              echo &quot;GIT_PR_SHA_SHORT = ${GIT_PR_SHA_SHORT}&quot;
              echo &quot;E2E_GIT_PR_SHA = ${E2E_GIT_PR_SHA}&quot;
  
    second-job:
      name: Build Docker Image
      runs-on: ubuntu-latest
  
      steps:
      - name: Second Echo Step
        run: |
              echo &quot;GIT_PR_SHA_SHORT = ${GIT_PR_SHA_SHORT}&quot;
              echo &quot;E2E_GIT_PR_SHA = ${E2E_GIT_PR_SHA}&quot;
  </code></pre>