name: Test variable usage
on:
workflow_dispatch:
env:
STEP_NAME_01 : "Say hello"
FRIENDLY_NAME : Joan
HELLO_VERSION : develop
jobs:
execute-hello-action-job:
name: execute-hello-action-job
runs-on: ubuntu-latest
steps:
- name: ${{STEP_NAME_01}} ## <<--- This is where I would like to use a variable
uses: github.com/no_repository_provided/hello-world@develop
with:
friendly_name: ${FRIENDLY_NAME}
有一个语法,可以让我提供该步骤的名称作为变量?
jobs.<job_id>.steps.name
,上下文是github
,
needs
,strategy
,matrix
,job
,runner
,env
,vars
,secrets
,steps
,inputs
。
在您的情况下,您想使用工作流级环境变量。这些可以通过
env
上下文访问:
steps:
- name: ${{ env.STEP_NAME_01 }}
# etc.