Skip to content

Commit

Permalink
Alessandro/create subtask on pr requested (#2692)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1207193414517319/f

**Description**:
This PR automates the creation of the Asana PR ticket when a GitHub reviewer is added to the PR.
  • Loading branch information
alessandroboron authored May 1, 2024
1 parent 632cb2e commit 04a7f6e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/actions/asana-create-action-item/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ runs:

- id: get-asana-user-id
if: github.event_name != 'schedule'
uses: duckduckgo/apple-infra/actions/asana-get-user-id-for-github-handle@main
uses: duckduckgo/apple-toolbox/actions/asana-get-user-id-for-github-handle@main
with:
access-token: ${{ inputs.access-token }}
github-handle: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/asana-log-message/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:

- id: get-asana-user-id
if: github.event_name != 'schedule'
uses: duckduckgo/apple-infra/actions/asana-get-user-id-for-github-handle@main
uses: duckduckgo/apple-toolbox/actions/asana-get-user-id-for-github-handle@main
with:
access-token: ${{ inputs.access-token }}
github-handle: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Get Asana user ID
id: get-asana-user-id
uses: duckduckgo/apple-infra/actions/asana-get-user-id-for-github-handle@main
uses: duckduckgo/apple-toolbox/actions/asana-get-user-id-for-github-handle@main
with:
access-token: ${{ secrets.ASANA_ACCESS_TOKEN }}
github-handle: ${{ github.actor }}
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/pr_task_url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Asana PR Task URL

on:
pull_request:
types: [opened, edited, closed, unlabeled, synchronize]
types: [opened, edited, closed, unlabeled, synchronize, review_requested]

jobs:

Expand Down Expand Up @@ -112,6 +112,24 @@ jobs:
if: ${{ needs.assert-project-membership.outputs.task_id }}
run: exit ${{ needs.assert-project-membership.outputs.failure }}

# When reviewer is assigned create a subtask in Asana if not existing already
create-asana-pr-subtask-if-needed:

name: "Create the PR subtask in Asana"

runs-on: ubuntu-latest
if: github.event.action == 'review_requested'

needs: [assert-project-membership]

steps:
- name: Create or Update PR Subtask
uses: duckduckgo/apple-toolbox/actions/asana-create-pr-subtask@main
with:
access-token: ${{ secrets.ASANA_ACCESS_TOKEN }}
asana-task-id: ${{ needs.assert-project-membership.outputs.task_id }}
github-reviewer-user: ${{ github.event.requested_reviewer.login }}

# When a PR is merged, move the task to the Waiting for Release section of the App Board.
mark-waiting-for-release:

Expand Down

0 comments on commit 04a7f6e

Please sign in to comment.