Skip to content

Commit 4cbb656

Browse files
authored
AzDO sync workflow: fix label handling and enable comment syncing (#207)
Signed-off-by: Brad Keryan <brad.keryan@ni.com> Signed-off-by: Brad Keryan <brad.keryan@ni.com>
1 parent 4112d81 commit 4cbb656

3 files changed

Lines changed: 17 additions & 19 deletions

File tree

.github/ISSUE_TEMPLATE/discussion.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/user_story.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name: User story
33
about: (DEV TEAM ONLY) A small chunk of work to be done
44
title: '(Fully descriptive title)'
5+
labels: 'user story,triage'
56
---
67

78
<!-- Ensure the title can be understood without the parent item's context, e.g. "nimble-button Angular wrapper" rather than just "Angular wrapper" -->

.github/workflows/sync_github_issues_to_azdo.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,34 @@ name: Sync issue to Azure DevOps work item
22

33
on:
44
issues:
5+
# Omit "labeled" and "unlabeled" to work around https://github.com/danhellem/github-actions-issue-to-work-item/issues/70
56
types:
6-
[opened, edited, deleted, closed, reopened, labeled, unlabeled, assigned]
7+
[opened, edited, deleted, closed, reopened, assigned]
8+
issue_comment:
9+
types: [created, edited, deleted]
710

811
jobs:
912
alert:
1013
runs-on: ubuntu-latest
1114
steps:
15+
- name: Choose work item type
16+
id: choose_work_item_type
17+
run: |
18+
if [ "${{ contains(github.event.issue.labels.*.name, 'enhancement') || contains(github.event.issue.labels.*.name, 'user story') }}" == "true" ]; then
19+
echo "work_item_type=User Story" >> $GITHUB_OUTPUT
20+
elif [ "${{ contains(github.event.issue.labels.*.name, 'tech debt') }}" == "true" ]; then
21+
echo "work_item_type=Technical Debt" >> $GITHUB_OUTPUT
22+
else
23+
echo "work_item_type=Bug" >> $GITHUB_OUTPUT
24+
fi
1225
- uses: danhellem/github-actions-issue-to-work-item@v2.1
1326
env:
14-
ado_token: "${{ secrets.AZDO_Work_Item_Token }}"
27+
ado_token: "${{ secrets.AZDO_WORK_ITEM_TOKEN }}"
1528
github_token: "${{ secrets.GH_REPO_TOKEN }}"
1629
ado_organization: "ni"
1730
ado_project: "DevCentral"
1831
ado_area_path: "DevCentral\\Product RnD\\PlatformSW\\Test System SW\\CBS\\Test Automation Frameworks"
19-
ado_wit: "Bug"
32+
ado_wit: "${{ steps.choose_work_item_type.outputs.work_item_type }}"
2033
ado_new_state: "New"
2134
ado_active_state: "Active"
2235
ado_close_state: "Closed"

0 commit comments

Comments
 (0)