Skip to content

environment: with workflow_call #1615

Answered by 0x2b3bfa0
dacbd asked this question in Q&A
Discussion options

You must be logged in to vote

Example with environment secrets

Given an environment named example containing an environment secret named TOKEN, the following triggered workflow will have access to that secret:

.github/workflows/triggering.yml

on: workflow_dispatch
jobs:
  check:
    uses: user/repository/.github/workflows/triggered.yml@main
    with:
      environment: example
    secrets:
      token: ${{ secrets.TOKEN }}

.github/workflows/triggered.yml

on:
  workflow_call:
    inputs:
      environment:
        required: true
        type: string
    secrets:
      token:
        required: true
jobs:
  check:
    environment: ${{ inputs.environment }}
    runs-on: ubuntu-latest
    steps:
    - run: echo ${{ secrets…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@dacbd
Comment options

@0x2b3bfa0
Comment options

@dacbd
Comment options

@0x2b3bfa0
Comment options

@dacbd
Comment options

Comment options

You must be logged in to vote
1 reply
@dacbd
Comment options

Answer selected by dacbd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants