Multiple tenant #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
echo "Creating ${{steps.gh.outputs.title}}" | |
echo "URL ${{steps.gh.outputs.url}}" | |
ado_title=$(echo ${{steps.gh.outputs.title}}) | |
ado_url=$(echo ${{steps.gh.outputs.url}}) | |
echo $ado_title | |
export AZURE_DEVOPS_EXT_PAT=${{ secrets.ADOPAT }} | |
az extension add --name azure-devops | |
ado_issue=$(az boards work-item create --title "$ado_title" --type 'Bug' -d $ado_url --org ${{ secrets.ADO_ORG }} -p ${{ secrets.ADO_PROJECT }} -o json --query "id") | |
az boards work-item relation add --id '104' --relation-type 'child' --target-id $ado_issue --org ${{ secrets.ADO_ORG }} |