Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        GitHub Actions course

        Environment precedence

        Opening GitHub Actions
        Your turn

        GitHub Actions environment variables and scope

        Variable scope

        A variable’s location determines which steps can use it. GitHub’s variable guide distinguishes workflow, job and step env definitions, along with expressions evaluated before work reaches a runner.

        Suppose a fictional report job uses REGION=west while one step overrides it with REGION=east. Trace the value for that step and then for the next one. A narrow override should not become a permanent workflow-wide change.

        Shells and later steps

        ${{ env.REGION }} is an expression reference. $REGION is shell syntax on a compatible shell. Moving a shell expression into a workflow field processed before the runner won’t make it evaluate there.

        A value written through an environment file is for later steps; it doesn’t retroactively rewrite the environment of the command that wrote it. For cross-job values, practice job outputs.

        The local model implements selected variable and expression behavior. It doesn’t execute every shell or reproduce a hosted runner’s full process environment.

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        New accounts get 12 hours of full access: every course, unit, project and exam. The clock starts when you open your first lesson.

        Plan your practice from a job ad or syllabus

        Have a referral code?

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.