env vars - concatenate

hi,
i got the following situation:
i set couple of custom env files using some other env vars plus some string but when I try to call them it shows the name of the var + the string

name: Laravel

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env: 
    BUILD_FILENAME: ${GITHUB_RUN_ID}.zip
    BUILD: ${GITHUB_RUN_ID}

jobs:
  laravel:

    runs-on: ubuntu-latest

......
- name: executing remote ssh commands using key
      uses: appleboy/ssh-action@master
      with:
        host: ${{ secrets.SERVER_IP }}
        username: ${{ secrets.USERNAME }}
        key: ${{ secrets.SSH_PRIVATE_KEY }}
        envs: BUILD, GITHUB_RUN_ID
        script: |
          pwd
          echo $BUILD 
          echo $BUILD_FILENAME

The outcome is:

out: ${GITHUB_RUN_ID}
out: ${GITHUB_RUN_ID}.zip

Please use triple backticks to wrap your yml:

on: push

env:
...
1 Like

For env, per Contexts - GitHub Docs you could use:

env: 
    BUILD_FILENAME: ${{ github.run_id}}.zip
    BUILD: ${{ github.run_id}}

Normally, if one had a local shell, one could just use $GITHUB_RUN_ID as in Environment variables - GitHub Docs, but that $varname is talking to the shell. whereas ${{ .... }} is talking to the GitHub Action Runtime.