From 76063f3571818eeea40304e032604d62747b8db2 Mon Sep 17 00:00:00 2001 From: Josh Johanning Date: Wed, 13 Nov 2024 17:10:41 -0600 Subject: [PATCH] use bash --- .github/workflows/migrate-work-items.yml | 68 ++++++++++++++++-------- 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/.github/workflows/migrate-work-items.yml b/.github/workflows/migrate-work-items.yml index df950b9..88cc3de 100644 --- a/.github/workflows/migrate-work-items.yml +++ b/.github/workflows/migrate-work-items.yml @@ -32,7 +32,7 @@ on: gh-repo: description: 'gh-org' required: true - default: 'migrate-ado-workitems' + default: 'migrating-ado-to-gh-issues-v2' gh_update_assigned_to: description: 'Update Assigned To' required: true @@ -68,30 +68,54 @@ jobs: app-id: 179484 private-key: ${{ secrets.PRIVATE_KEY }} - - name: run migration - shell: pwsh - run: | - # run migration script + # - 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="" + # $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_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.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_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" - } + # 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 + # ./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