Skip to content

Using environment in workflow_call #25238

Discussion options

You must be logged in to vote

I was finally able to get a solution/clarification from GitHub support. The following example outputs “Match” if you have an environment called TestEnvironment with a secret called TEST_SECRET set to 123 in your repository.

name: Test Parent
on: push
jobs:
  Job1:
    uses: ./.github/workflows/test_child.yml
    secrets:
      TEST_SECRET: ${{ secrets.TEST_SECRET }}
name: Test Child
on: 
  workflow_call:
    secrets:
      TEST_SECRET:
        required: true
jobs:
  Job1:
    runs-on: ubuntu-latest
    environment: TestEnvironment
    steps:
      - name: Step 1
        run: |
          if [ "${{ secrets.TEST_SECRET }}" == "123" ]; then
            echo "Match"
          else
           …

Replies: 7 comments 13 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
13 replies
@tleerai
Comment options

@hcastrofactored
Comment options

@tleerai
Comment options

@mariusfilipowski
Comment options

@gilfthde
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Product Feedback