您目前可以通过以下方式设置env:
- name: Configure Environment Variables
uses: allenevans/set-env@v1.0.0
with:
CDN_PATH: app-foo/${{ github.run_id }}
CDN_URL: 'https://cdn.mycompany.com'
JIRA_TICKET_ID: ${{ match(github.ref, ...) }} # How can I extract a string from a branch name?如何从分支名称中提取字符串?
JIRA_TICKET_ID: ${{ match(github.ref, ...) }}
发布于 2020-08-27 16:39:50
我不相信在github的操作中有一个构建的功能来做到这一点。但是,您可以在您的操作之前运行一个步骤,为您获取jira票据。
注意:您需要将sed正则表达式修改为获取票证的正则表达式。现在,它只从ref获取分支名称。
- id: getjiraticket
run: echo "::set-output name=jiraticketid::`echo "${{ github.ref }}" | sed 's/.*\///'`"
- name: Configure Environment Variables
uses: allenevans/set-env@v1.0.0
with:
CDN_PATH: app-foo/${{ github.run_id }}
CDN_URL: 'https://cdn.mycompany.com'
JIRA_TICKET_ID: ${{ steps.getjiraticket.outputs.jiraticketid }}https://stackoverflow.com/questions/63618762
复制相似问题