Skip to content

Migrate Work Items

Migrate Work Items #19

name: Migrate Work Items
on:
workflow_dispatch:
inputs:
ado-org:
description: 'ado-org'
required: true
default: 'POCHCLTEAM'
ado-project:
description: 'ado-project'
required: true
default: 'DemoHCLProject'
ado_area_path:
description: 'ADO area path to migrate - uses the UNDER operator'
required: true
default: 'DemoHCLProject\DevArea'
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: 'true'
gh-org:
description: 'gh-org'
required: true
default: 'devidayalhclteam'
gh-repo:
description: 'gh-org'
required: true
default: 'ado_workitems_to_github_issues'
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: windows-latest
steps:
- uses: actions/checkout@main
- uses: tibdex/github-app-token@v1
id: get_installation_token
with:
app_id: 363216
installation_id: 39793963
private_key: "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAnU1BTlVO0pco9EACCW/HLxG1MIrrRmZT4ggTqEHi+dJB4zal\nN10rMO/8bAwOUHeifcuGMe2zws7bAHw5abNQw1r+jfkzdsAJibR57e+KYscr2ZcI\njcE9635wF354HOXmIjmIYKYXHk7SXe+wq1npAwcQcldrcrLVJ25unG0uKb2oOI73\n2n4fnwrZF6RetYtKpbdpOG9nMk1kAysoT0HW5d5+wuu+w4czjIiX6gkdDgoSTVzx\n66Mf2C3Jzx4IGypOhupOMqldnLd0/0mq1qrHb0QetJLgmN32NghA+n2zW9Ey1/9q\nafaIduo9G1cTyIJJOif/VJo5VhCXxFkTemP7QQIDAQABAoIBAHSxXSMpcgIUFVOt\nMFWj0JYAgvPx+rwNKWljKIIH7sP50NsoLMS3n1T8k7vr7aqQNcEwfOsJNfPs1Na1\nUToyxl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8S6CL3X45f4zEYSiYZOCHk30\n9Hx3vfxPqP366Sx6NP3jNFVDb8kI2S1sRDuGh7mzKjhZ8WlAIOcxyQ==\n-----END RSA PRIVATE KEY-----"
- name: run migration
shell: pwsh
run: |
# run migration script
# cleaning up bools
$ado_migrate_closed_workitems=$false
$ado_production_run=$false
$gh_update_assigned_to=$false
$gh_add_ado_comments=$false
if("${{ github.event.inputs.ado_migrate_closed_workitems }}" -eq "true") {
$ado_migrate_closed_workitems=$true
}
if("${{ github.event.inputs.ado_production_run }}" -eq "true") {
$ado_production_run=$true
}
if("${{ github.event.inputs.gh_update_assigned_to }}" -eq "true") {
$gh_update_assigned_to=$true
}
if("${{ github.event.inputs.gh_add_ado_comments }}" -eq "true") {
$gh_add_ado_comments=$true
}
./ado_workitems_to_github_issues.ps1 -ado_pat "qxwohdyeo5mmcchckfr3iwlpecc5zoraglju5a2rjbb2yyc3axuq" -ado_org "POCHCLTEAM" -ado_project "DemoHCLProject" -ado_area_path "${{ github.event.inputs.ado_area_path }}" -ado_migrate_closed_workitems $ado_migrate_closed_workitems -ado_production_run $ado_production_run -gh_pat "${{ steps.get_installation_token.outputs.token }}" -gh_org "devidayalhclteam" -gh_repo "ado_workitems_to_github_issues" -gh_update_assigned_to $gh_update_assigned_to -gh_assigned_to_user_suffix "${{ github.event.inputs.gh_assigned_to_user_suffix }}" -gh_add_ado_comments $gh_add_ado_comments