From 4f3cf0daca96f4c0348175e2ec55d0939adef430 Mon Sep 17 00:00:00 2001 From: Julian Dehm Date: Wed, 16 Oct 2024 09:00:21 +0200 Subject: [PATCH] add github actions to sync with asana - sync issues to asana - link PRs to tasks (if a task is specified in the PR description) - add comment to task if PR was approved - add comment to task if PR was merged (optional: mark task as completed) --- .github/workflows/asana-link-pr-to-task.yml | 14 ++++++++++++++ .github/workflows/asana-notify-approved.yml | 17 +++++++++++++++++ .github/workflows/asana-notify-merged.yml | 15 +++++++++++++++ .github/workflows/asana-sync-issues.yml | 13 +++++++++++++ changelog/_1113.md | 7 +++++++ 5 files changed, 66 insertions(+) create mode 100644 .github/workflows/asana-link-pr-to-task.yml create mode 100644 .github/workflows/asana-notify-approved.yml create mode 100644 .github/workflows/asana-notify-merged.yml create mode 100644 .github/workflows/asana-sync-issues.yml create mode 100644 changelog/_1113.md diff --git a/.github/workflows/asana-link-pr-to-task.yml b/.github/workflows/asana-link-pr-to-task.yml new file mode 100644 index 0000000000..ae4d6d7c07 --- /dev/null +++ b/.github/workflows/asana-link-pr-to-task.yml @@ -0,0 +1,14 @@ +on: + pull_request: + types: [opened, reopened] + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Add comment in Asana task + uses: duckduckgo/native-github-asana-sync@v1.1 + with: + asana-pat: ${{ secrets.GH_ASANA_SECRET }} + trigger-phrase: 'STORY:' + action: 'add-asana-comment' diff --git a/.github/workflows/asana-notify-approved.yml b/.github/workflows/asana-notify-approved.yml new file mode 100644 index 0000000000..f85e80ea3a --- /dev/null +++ b/.github/workflows/asana-notify-approved.yml @@ -0,0 +1,17 @@ +name: Pull Request Reviewed + +on: + pull_request_review: + types: [submitted] + +jobs: + pr-reviewed: + if: github.event.review.state == 'approved' + runs-on: ubuntu-latest + steps: + - name: Update Asana task -> PR approved + uses: duckduckgo/native-github-asana-sync@v1.1 + with: + asana-pat: ${{ secrets.GH_ASANA_SECRET }} + trigger-phrase: "STORY:" + action: 'notify-pr-approved' diff --git a/.github/workflows/asana-notify-merged.yml b/.github/workflows/asana-notify-merged.yml new file mode 100644 index 0000000000..496ebf3f59 --- /dev/null +++ b/.github/workflows/asana-notify-merged.yml @@ -0,0 +1,15 @@ +on: + pull_request: + types: [closed] + +jobs: + add-pr-merged-comment: + runs-on: ubuntu-latest + steps: + - uses: duckduckgo/native-github-asana-sync@v1.1 + if: github.event.pull_request.merged + with: + asana-pat: ${{ secrets.GH_ASANA_SECRET }} + trigger-phrase: 'STORY:' + action: 'notify-pr-merged' + is-complete: false diff --git a/.github/workflows/asana-sync-issues.yml b/.github/workflows/asana-sync-issues.yml new file mode 100644 index 0000000000..e8677a19e0 --- /dev/null +++ b/.github/workflows/asana-sync-issues.yml @@ -0,0 +1,13 @@ +on: + issues: + types: [opened, reopened] + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: duckduckgo/native-github-asana-sync@v1.1 + with: + asana-pat: ${{ secrets.GH_ASANA_SECRET }} + asana-project: ${{ vars.GH_ASANA_PROJECT_ID }} + action: 'create-asana-issue-task' diff --git a/changelog/_1113.md b/changelog/_1113.md new file mode 100644 index 0000000000..b1da058022 --- /dev/null +++ b/changelog/_1113.md @@ -0,0 +1,7 @@ +### Added + +- add github workflow to + - sync issues to asana + - link PRs to tasks (if a task is specified in the PR description) + - add comment to task if PR was approved + - add comment to task if PR was merged (optional: mark task as completed)