无论如何,在那里使用github动作步骤中使用变量'name'

问题描述 投票:0回答:1
the given的github工作流程,看起来像这样:

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}
有一个语法,可以让我提供该步骤的名称作为变量?

github github-actions
1个回答
0
投票
jobs.<job_id>.steps.name

,上下文是github

needs
strategy
matrix
job
runner
env
vars
secrets
steps
inputs
在您的情况下,您想使用工作流级环境变量。这些可以通过
env
上下文访问:

steps: - name: ${{ env.STEP_NAME_01 }} # etc.

	

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.