Okay, here is a common example how to set ENVs if we have a bash shell:
...
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set environment variable
shell: bash
run: echo "ENV_NAME=ENV_VALUE" >> "${GITHUB_ENV}"
- name: Get environment variable
shell: bash
run: echo "A value of ENV_NAME is ${{ env.ENV_NAME }}"
But what if our shell is a python?:
...
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set environment variable with python
shell: python
# How to set ENV with python?
run: ???
How to set ENV with python?
file.WriteLinesfunction should work just fine.