使用“context”变量,在一个步骤中设置一个变量,在随后的步骤中使用该变量。在步骤中使用$符号引用变量。
示例代码:
- name: set variable
run: echo "::set-output name=my_var::hello world"
id: my_step
- name: use variable in next step
run: echo ${{ steps.my_step.outputs.my_var }}
上一篇:变量和引用之间的关系