Github Actions Workflow Environment Variables Secrets

I’ve search everywhere and I still can’t find something that works for me.

I am trying to access the github environment secrets I set for my repository, but each time I reference it, I get an empty value back.

Below you can see that I’m calling the secrets.DELETE key in the env: and that I"m also trying to set it below but at neither point is the environment variable DELETE set.

name: Django CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'     
        required: true
        default: 'warning' 
        type: choice
        options:
        - info
        - warning
        - debug 
      tags:
        description: 'Test scenario tags'
        required: false 
        type: boolean
      environment:
        description: 'Environment to run tests against'
        type: environment
        required: true 

env:
  DELETE: ${{ secrets.delete }}

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.7, 3.8, 3.9]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install Dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
    - name: Lint with Flake8
      run: |
        flake8 .
    - name: mess around
      env:
        DELETE: ${{ secrets.delete }}
      run: echo "$DELETE"
    - name: Run Tests
      run: |
        python manage.py test


The secrets are set in my repository.

I’m not sure what I’m missing.

You might try:

1 Like

Wow okay after reading this I went to go add the ACTIONS_RUNNER_DEBUG secret key and realized I had put my secret keys under the environment secret keys instead of repository. After changing it, it worked!

Thanks a lot!