In GitHub Action, how to build environment variables one after another:
name: workflow-level-custom-environment-variables
on: [push]
# Here the environment variable is declared in workflow level
env:
PART1: var1
PART2: ${PART1}var2
PUBLICENV: ${PART2} Available for all jobs in this workflow
This can be really useful, for e.g., here is a real-life example from Dockerfile:
ARG JMETER_VERSION="5.4.2"
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
I know Dockerfile is not GitHub Action, but I'm just showing the principle when it can be useful.