I'm trying to access GitHub SECRETS and VARIABLES set at the Repo level and at the Organization level for a GitHub "Actions" script.
Here is the script:
name: CI (pip)
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: ['ubuntu-latest']
python-version: [3.9] # installed version on Dreamhost
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: First Test
run: |
echo ORG_NAME = ${{ env.ORG_NAME}}
echo MY_NAME = ${{ env.MY_NAME}}
echo MY_SECRET = ${{ secrets.MY_SECRET }}
- name: Second Test
env:
ORG_NAME_ENV: ${{ env.ORG_NAME }}
MY_NAME_ENV: ${{ env.MY_NAME }}
MY_SECRET: ${{ secrets.MY_SECRET }}
run: |
echo ORG_NAME_ENV = $ORG_NAME_ENV
echo MY_SECRET = $MY_SECRET
echo SHA256 = `echo $MY_SECRET | openssl sha256`
This just doesn't work. The secrets.MY_SECRET
gets set, but env.ORG_NAME
and env.MY_NAME
do not get set.
Here is what the config looks like:
Organization level actions secrets and variables:
Repo secrets:
Repo level variables:
I can access the secrets, but not the variables.
Here is what the output looks like:
Oh, MY_SECRET=secret
, in case you don't want to do the hash search.