From 69cae03b8b51b7d66d37e45a72418d59fda3912d Mon Sep 17 00:00:00 2001 From: Brad Keryan Date: Mon, 6 Apr 2026 16:16:15 -0500 Subject: [PATCH 1/2] github: Update sync_github_issues_to_azdo to use the 'case' function --- .github/workflows/sync_github_issues_to_azdo.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sync_github_issues_to_azdo.yml b/.github/workflows/sync_github_issues_to_azdo.yml index c1f0e559..e531a0b4 100644 --- a/.github/workflows/sync_github_issues_to_azdo.yml +++ b/.github/workflows/sync_github_issues_to_azdo.yml @@ -13,16 +13,6 @@ jobs: if: ${{ !github.event.issue.pull_request && github.event.issue.title != 'Dependency Dashboard' }} runs-on: ubuntu-latest steps: - - name: Choose work item type - id: choose_work_item_type - run: | - if [ "${{ contains(github.event.issue.labels.*.name, 'enhancement') || contains(github.event.issue.labels.*.name, 'user story') }}" == "true" ]; then - echo "work_item_type=User Story" >> $GITHUB_OUTPUT - elif [ "${{ contains(github.event.issue.labels.*.name, 'tech debt') }}" == "true" ]; then - echo "work_item_type=Technical Debt" >> $GITHUB_OUTPUT - else - echo "work_item_type=Bug" >> $GITHUB_OUTPUT - fi - uses: danhellem/github-actions-issue-to-work-item@45eb3b46e684f2acd2954f02ef70350c835ee4bb # v2.4 env: ado_token: "${{ secrets.AZDO_WORK_ITEM_TOKEN }}" @@ -30,7 +20,10 @@ jobs: ado_organization: "ni" ado_project: "DevCentral" ado_area_path: "DevCentral\\Product RnD\\Platform HW and SW\\SW New Invest and Tech\\ETW\\Python CodeGen" - ado_wit: "${{ steps.choose_work_item_type.outputs.work_item_type }}" + ado_wit: "${{ case( + contains(github.event.issue.labels.*.name, 'enhancement') || contains(github.event.issue.labels.*.name, 'user story'), 'User Story', + contains(github.event.issue.labels.*.name, 'tech debt'), 'Technical Debt', + 'Bug') }}" ado_new_state: "New" ado_active_state: "Active" ado_close_state: "Closed" From 57d7f5a9ef9452a66a8e19e2f52cd4592d9e8e4b Mon Sep 17 00:00:00 2001 From: Brad Keryan Date: Mon, 6 Apr 2026 16:18:29 -0500 Subject: [PATCH 2/2] github: Update publish.yml to use the 'case' function --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e194efea..c0f7ed2c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ on: env: dist-artifact-name: nitypes-distribution-packages - environment: ${{ github.event_name == 'release' && 'pypi' || inputs.environment }} + environment: ${{ case(github.event_name == 'release', 'pypi', inputs.environment) }} environment-info: | { "pypi": { @@ -65,7 +65,7 @@ jobs: needs: [build_nitypes] environment: # This logic is duplicated because `name` doesn't support the `env` context. - name: ${{ github.event_name == 'release' && 'pypi' || inputs.environment }} + name: ${{ case(github.event_name == 'release', 'pypi', inputs.environment) }} url: ${{ fromJson(env.environment-info)[env.environment].base-url }}/p/nitypes permissions: id-token: write