-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (110 loc) · 4.99 KB
/
migrate-work-items.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Migrate Work Items
on:
workflow_dispatch:
inputs:
ado-org:
description: 'ado-org'
required: true
default: 'jjohanning0798'
ado-project:
description: 'ado-project'
required: true
default: 'PartsUnlimited'
ado_area_path:
description: 'ADO area path to migrate - uses the UNDER operator'
required: true
default: 'migrate'
ado_migrate_closed_workitems:
description: 'Migrate closed work items'
required: true
type: boolean
default: 'true'
ado_production_run:
description: tag migrated work items with migrated-to-github and add discussion comment
required: true
type: boolean
default: 'false'
gh-org:
description: 'gh-org'
required: true
default: 'joshjohanning-org'
gh-repo:
description: 'gh-org'
required: true
default: 'migrating-ado-to-gh-issues-v2'
gh_update_assigned_to:
description: 'Update Assigned To'
required: true
type: boolean
default: 'true'
gh_assigned_to_user_suffix:
description: 'EMU suffix'
required: true
default: '_corp'
gh_add_ado_comments:
description: 'Add ADO Comments'
required: true
type: boolean
default: 'true'
jobs:
migrate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# - uses: tibdex/github-app-token@v1
# id: get_installation_token
# with:
# app_id: 179484
# installation_id: 23995058
# private_key: ${{ secrets.PRIVATE_KEY }}
- name: get az and az devops version
run: az --version
- name: get gh version
run: gh --version
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: 179484 # work-item-migrator
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
# - name: run migration
# shell: pwsh
# run: |
# # run migration script
# $ado_migrate_closed_workitems_param=""
# $ado_production_run_param=""
# $gh_update_assigned_to_param=""
# $gh_add_ado_comments_param=""
# if("${{ github.event.inputs.ado_migrate_closed_workitems }}" -eq "true") {
# $ado_migrate_closed_workitems_param="-ado_migrate_closed_workitems"
# }
# if("${{ github.event.inputs.ado_production_run }}" -eq "true") {
# $ado_production_run_param="-ado_production_run"
# }
# if("${{ github.event.inputs.gh_update_assigned_to }}" -eq "true") {
# $gh_update_assigned_to_param="-gh_update_assigned_to"
# }
# if("${{ github.event.inputs.gh_add_ado_comments }}" -eq "true") {
# $gh_add_ado_comments_param="-gh_add_ado_comments"
# }
# ./ado_workitems_to_github_issues.ps1 -ado_pat "${{ SECRETS.ADO_PAT }}" -ado_org "${{ github.event.inputs.ado-org }}" -ado_project "${{ github.event.inputs.ado-project }}" -ado_area_path "${{ github.event.inputs.ado_area_path }}" $ado_migrate_closed_workitems_param $ado_production_run_param -gh_pat "${{ steps.get_installation_token.outputs.token }}" -gh_org "${{ github.event.inputs.gh-org }}" -gh_repo "${{ github.event.inputs.gh-repo }}" $gh_update_assigned_to_param -gh_assigned_to_user_suffix "${{ github.event.inputs.gh_assigned_to_user_suffix }}" $gh_add_ado_comments_param
- name: run migration
shell: bash
run: |
ado_migrate_closed_workitems_param=""
ado_production_run_param=""
gh_update_assigned_to_param=""
gh_add_ado_comments_param=""
if [ "${{ github.event.inputs.ado_migrate_closed_workitems }}" == "true" ]; then
ado_migrate_closed_workitems_param="--ado_migrate_closed_workitems"
fi
if [ "${{ github.event.inputs.ado_production_run }}" == "true" ]; then
ado_production_run_param="--ado_production_run"
fi
if [ "${{ github.event.inputs.gh_update_assigned_to }}" == "true" ]; then
gh_update_assigned_to_param="--gh_update_assigned_to"
fi
if [ "${{ github.event.inputs.gh_add_ado_comments }}" == "true" ]; then
gh_add_ado_comments_param="--gh_add_ado_comments"
fi
pwsh ./ado_workitems_to_github_issues.ps1 -ado_pat "${{ SECRETS.ADO_PAT }}" -ado_org "${{ github.event.inputs.ado-org }}" -ado_project "${{ github.event.inputs.ado-project }}" -ado_area_path "${{ github.event.inputs.ado_area_path }}" $ado_migrate_closed_workitems_param $ado_production_run_param -gh_pat "${{ steps.app-token.outputs.token }}" -gh_org "${{ github.event.inputs.gh-org }}" -gh_repo "${{ github.event.inputs.gh-repo }}" $gh_update_assigned_to_param -gh_assigned_to_user_suffix "${{ github.event.inputs.gh_assigned_to_user_suffix }}" $gh_add_ado_comments_param