зеркало из https://github.com/Azure/CCOInsights.git
Create issues from GH to ADO (#274)
This commit is contained in:
Родитель
bebaf334e2
Коммит
c04f35df4e
|
@ -0,0 +1,32 @@
|
|||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
jobs:
|
||||
create_ado_pbi:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
name: 'Get GH issue'
|
||||
id: gh
|
||||
shell: pwsh
|
||||
run: |
|
||||
$gh_issue_json = gh issue view ${{ github.event.issue.html_url }} --json assignees,author,body,closed,closedAt,comments,createdAt,id,labels,milestone,number,projectCards,reactionGroups,state,title,updatedAt,url
|
||||
$gh_issue = ConvertFrom-Json $gh_issue_json
|
||||
#$gh_issue.title
|
||||
echo "::set-output name=title::$($gh_issue.title)"
|
||||
echo "::set-output name=url::$($gh_issue.url)"
|
||||
|
||||
- name: 'Create PBI in ADO'
|
||||
id: ado
|
||||
uses: azure/CLI@v1
|
||||
with:
|
||||
azcliversion: 2.30.0
|
||||
inlineScript: |
|
||||
ado_title=$(echo ${{steps.gh.outputs.title}})
|
||||
ado_url=$(echo ${{steps.gh.outputs.url}})
|
||||
export AZURE_DEVOPS_EXT_PAT=${{ secrets.ADO_PAT }}
|
||||
az extension add --name azure-devops
|
||||
ado_issue=$(az boards work-item create --title $ado_title --type 'Bug' -d $ado_url --org 'https://dev.azure.com/strategy-and-solutions/' -p 'product-portfolio' -o json --query "id")
|
||||
az boards work-item relation add --id '104' --relation-type 'child' --target-id $ado_issue --org 'https://dev.azure.com/strategy-and-solutions/'
|
Загрузка…
Ссылка в новой задаче