From 1a856801acb5d49d5925fd3d78012542b409b812 Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Wed, 6 Mar 2024 15:26:47 +0100 Subject: [PATCH] Use asana-get-user-id-for-github-handle from apple-infra to extract assignee ID --- .github/workflows/code_freeze.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code_freeze.yml b/.github/workflows/code_freeze.yml index d3eb6f886c..d08263e68d 100644 --- a/.github/workflows/code_freeze.yml +++ b/.github/workflows/code_freeze.yml @@ -44,11 +44,19 @@ jobs: git config --global user.name "Dax the Duck" git config --global user.email "dax@duckduckgo.com" bundle exec fastlane make_release_branch + + - name: Get Asana user ID + id: get-asana-user-id + uses: duckduckgo/apple-infra/actions/asana-get-user-id-for-github-handle@main + with: + access-token: ${{ secrets.ASANA_ACCESS_TOKEN }} + github-handle: ${{ github.actor }} - name: Create release task id: create_release_task env: ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} + ASSIGNEE_ID: ${{ steps.get-asana-user-id.outputs.user-id }} run: | version="$(echo ${{ steps.make_release_branch.outputs.release_branch_name }} | cut -d '/' -f 2)" task_name="macOS App Release $version" @@ -67,14 +75,11 @@ jobs: --output /dev/null \ -d "{\"data\": {\"task\": \"${asana_task_id}\"}}" - assignee_id="$(curl -fLSs https://raw.githubusercontent.com/duckduckgo/BrowserServicesKit/main/.github/actions/asana-failed-pr-checks/user_ids.json \ - | jq -r .${{ github.actor }})" - curl -fLSs -X PUT "https://app.asana.com/api/1.0/tasks/${asana_task_id}" \ -H "Authorization: Bearer ${{ env.ASANA_ACCESS_TOKEN }}" \ -H "Content-Type: application/json" \ --output /dev/null \ - -d "{ \"data\": { \"assignee\": \"$assignee_id\" }}" + -d "{ \"data\": { \"assignee\": \"$ASSIGNEE_ID\" }}" - name: Update Asana tasks for the release env: