Skip to content

test env workflow

test env workflow #1

Workflow file for this run

name: Test ENV NAME
on:
push:
branches:
- 'chore/hide_env_names'
paths:
- 'api/**'
- 'client/**'
- 'tiler/**'
- '.github/**'
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
outputs:
env_name: ${{ steps.set_env_name.outputs.env_name }}
steps:
- name: Set ENV_NAME
id: set_env_name
run: |

Check failure on line 22 in .github/workflows/test_env.yml

View workflow run for this annotation

GitHub Actions / Test ENV NAME

Invalid workflow file

The workflow is not valid. .github/workflows/test_env.yml (Line: 22, Col: 14): Unrecognized named-value: 'SECRET_NAME'. Located at position 9 within expression: secrets[SECRET_NAME]
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
if [[ "$BRANCH_NAME" == "main" || "$BRANCH_NAME" == "staging" || "$BRANCH_NAME" == "test" || "$BRANCH_NAME" == "dev" ]]; then
echo "ENV_NAME=$BRANCH_NAME" >> $GITHUB_ENV
echo "::set-output name=env_name::$BRANCH_NAME"
else
SECRET_NAME="SECRET_${BRANCH_NAME^^}"
ENV_VALUE=$(echo ${{ secrets[SECRET_NAME] }})
echo "ENV_NAME=$ENV_VALUE" >> $GITHUB_ENV
echo "::set-output name=env_name::$ENV_VALUE"
fi
print_env_name:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Print ENV_NAME
run: echo "ENV_NAME is ${{ needs.setup.outputs.env_name }}"