VAR1=value1
VAR2=value2
VAR3=value3
VAR4=value4
VAR5=value5
VAR6=value6
VAR7=value7
VAR8=value8
VAR9=value9
- name: setup environments
run: |
echo "${{ secrets.ENVIRONMENTS }}" > .env
import os
print(os.getenv("VAR3")
name: PIPENV
on:
workflow_dispatch:
jobs:
build:
runs-on: 任意の実行環境
steps:
- uses: actions/checkout@v3
- name: install python
uses: actions/setup-python@v5
with:
python-version: "v3.11.1"
- name: install pipenv
run: |
python -m pip install --upgrade pip
python -m pip install pipenv=="2023.4.29"
- name: setup environments
run: |
echo "${{ secrets.ENVIRONMENTS }}" > .env
cat .env
- name: pipenv
run: |
pipenv run python -c "import os; print(os.getenv('VAR3'))"
実行結果(直接の出力はマスクされる)
Run echo "***
echo "***
***
***
***
***
***
***
***
***" > .env
cat .env
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.11.1/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.1/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.1/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.1/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.1/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.1/x64/lib
***
***
***
***
***
***
***
***
***
実行結果(スクリプトから参照しての出力は表示されてしまう)
Run pipenv run python -c "import os; print(os.getenv('VAR3'))"
Loading .env environment variables...
(略)
value3