Skip to content

How to pass parameters to Github Actions Workflow #27002

Answered by Yanjingzhu
missedone asked this question in Actions
Discussion options

You must be logged in to vote

Hi @missedone , 

I am not sure whether I fully understood your requirement. Based on my understanding , you want github workflow to receive deployment evetnt payload and use the payload content in your workflow run. 

There is a github context for you to use which includes the deployment event payload.

And you could use ${{ }} syntax to get the value of json key value. Such as 

${{ github.event.deployment.environment }} 

There is an example of workflow yml to get environment name: 

name: deployment
on:
  deployment
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
     - name: Dump GitHub context
       env:
          GITHUB_CONTEXT: ${{ tojson(git…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
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
3 participants