Skip to content

Manipulate event data in python #26834

Discussion options

You must be logged in to vote

One way can be to pass this information via env keyword and then access it in python with os.environ.

In Action, set github as an environment variable:

- name: pass env variable to python
  env: 
    GITHUB_CONTEXT: ${{ toJson(github) }}
  run: python test.py

In Python, you can access this with os.environ

import os
print(os.environ['GITHUB_CONTEXT'])

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