This action integrates asana with github.
- Asana account with the permission on the particular project you want to integrate with.
- For creating tasks in Asana, you must provide the Asana project where the issues will be added to.
- For adding PR link to Asana, you must provide the task url in the PR description.
Required Your public access token of asana, you can find it in asana docs.
required The action to be performed. Possible values are
create-asana-issue-task
to create a task based on the Github Issuenotify-pr-approved
to add a comment to the Asana task when the PR has been approvednotify-pr-merged
to complete the Asana task when a PR has been mergedcheck-pr-membership
checks the PR sender membership in the organisation that owns the repoadd-asana-comment
adds a comment to the Asana task with the link to the Pull Requestadd-task-asana-project
adds a task to a project / section in Asanacreate-asana-pr-task
to create a task in Asana based on the Github Pull Requestget-latest-repo-release
to find the latest release version of a Github Repositorycreate-asana-task
to create a task in Asanaget-asana-user-id
to return the Asana User Id of a given Github actorfind-asana-task-id
searches in the PR description for an Asana Task, given a prefixpost-comment-asana-task
to post a comment in an Asana task
When a Github Issue has been added, it will create an Asana task with the Issue title, description and link.
Required The Asana project ID where the new task will be added i.e ASANA PROJECT: https://app.asana.com/0/1174433894299346
on:
issues:
types: [opened, reopened]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: duckduckgo/[email protected]
with:
asana-pat: 'Your PAT'
asana-project: 'Asana Project Id'
action: 'create-asana-issue-task'
When a Pull Request has been reviewed, it will look for an Asana task in the PR description and comment on it.
Required Prefix before the task i.e ASANA TASK: https://app.asana.com/1/2/3/.
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/[email protected]
with:
asana-pat: 'Your PAT'
trigger-phrase: 'Your Trigger Phrase'
action: 'notify-pr-approved'
When a Github Pull Request has been closed, it will look for an Asana task in the PR description and close it.
optional Close the Asana task after Github PR merged when set to true
on:
pull_request:
types: [closed]
jobs:
add-pr-merged-comment:
runs-on: ubuntu-latest
steps:
- uses: duckduckgo/[email protected]
if: github.event.pull_request.merged
with:
asana-pat: 'Your PAT'
trigger-phrase: 'Your Trigger Phrase'
action: 'notify-pr-merged'
is-complete: true
When a Github Pull Request has been opened, it will check if the sender is a member of the organisation. This is one of the step of a bigger workflow, that process PRs differently depending if it's a community PR or not. Required Prefix before the task i.e ASANA TASK: https://app.asana.com/1/2/3/.
Required Github public access token
on:
pull_request:
types: [opened, reopened]
jobs:
validate-pr:
name: Validate Pull Request
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.step1.outputs.external }}
steps:
- name: Checking Pull Request sender membership
id: step1
uses: duckduckgo/[email protected]
with:
github-pat: 'Your Github PAT'
action: 'check-pr-membership'
For PRs that are opened by members of the organisation, it will look for an Asana task in the PR description and comment on it with the PR link.
Required Prefix before the task i.e ASANA TASK: https://app.asana.com/1/2/3/.
optional Pinned the PR comment when set to true
`` Asana Task: https://app.asana.com/0/1/2
on:
pull_request:
types: [opened, reopened]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Add comment in Asana task
uses: duckduckgo/[email protected]
with:
asana-pat: 'Your PAT'
trigger-phrase: 'Your Trigger Phrase'
action: 'add-asana-comment'
Adds a task to an Asana project and section. The action will look for an Asana task in the PR description.
Required Prefix before the task i.e ASANA TASK: https://app.asana.com/1/2/3/.
Required Id of the Asana project that the task will be added to. Task will be added to the top of the project.
optional Id of the Asana section in the Asana project. Task will be added to the top of the section.
on:
pull_request:
types: [opened, reopened]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Add Asana task to Project
uses: duckduckgo/[email protected]
with:
trigger-phrase: 'Your Trigger Phrase'
asana-project: 'Asana Project Id'
asana-section: 'Asana Section Id'
action: 'add-task-asana-project'
When a Github Pull Request has been added by a community contributor, it will create an Asana task with the Pull Request title, description and link.
Required The Asana project ID where the new task will be added i.e ASANA PROJECT: https://app.asana.com/0/1174433894299346
on:
issues:
types: [opened, reopened]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Create Asana task in Asana Project
uses: duckduckgo/[email protected]
with:
asana-project: 'Asana Project Id'
action: 'create-asana-pr-task'
Finds the latest release version of a Github Repository.
Required Repository to check for the latest version.
Required Organisation that owns the Repository.
on:
workflow_dispatch:
jobs:
find-latest-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.latest-release.outputs.version }}
steps:
- name: Find latest release of content scope scripts
id: latest-release
uses: duckduckgo/[email protected]
with:
github-pat: 'Your Github PAT'
github-repository: 'Github Repository'
github-org: 'Github Organisation'
action: 'get-latest-repo-release'
Creates an Asana task with the properties defined below.
Required The Asana project ID where the new task will be added i.e ASANA PROJECT: https://app.asana.com/0/1174433894299346
The Asana section ID in the Asana Project
Required Name of the Asana task
Required Description of the Asana task
Comma-separated IDs of Asana tags to be added to the task i.e. https://app.asana.com/0/1208613272217946/
Comma-separated Asana user IDs to be added as collaborators to the task
- Note: you can use https://app.asana.com/api/1.0/users/me to find your ID. Replace
me
with an email to find someone else's
on:
issues:
types: [opened, reopened]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Create Asana task in Asana Project
uses: duckduckgo/[email protected]
with:
asana-project: 'Asana Project Id'
asana-section: 'Asana Section Id'
asana-task-name: 'Asana Task Name'
asana-task-description: 'Asana Task Description'
asana-tag: 'Tag Id'
action: 'create-asana-task'
Returns Asana user ID for a provided Github username
Required Github public access token
Github user to lookup; PR author by default
on:
pull_request:
types: [ labeled ]
jobs:
test-job:
runs-on: ubuntu-latest
steps:
- name: Get PR author Asana ID
uses: ./actions
id: get-author-asana-id
with:
github-pat: ${{ secrets.github_pat }}
action: 'get-asana-user-id'
- name: Use Asana ID from above step
with:
asana-collaborators: '${{ steps.get-author-asana-id.outputs.asanaUserId }}'
Searches for an Asana URL in the PR description, given a prefix. Returns the Asana Task Id if found.
Required Prefix before the task i.e ASANA TASK: https://app.asana.com/1/2/3/.
on:
pull_request_review:
types: [submitted]
jobs:
test-job:
runs-on: ubuntu-latest
steps:
- name: Find Asana Task in PR description
uses: ./actions
id: find-asana-task-id
with:
action: 'find-asana-task-id'
trigger-phrase: 'Task/Issue URL:'
- name: Use Asana Task ID from above step
with:
asana-task-id: '${{ steps.find-asana-task-id.outputs.asanaTaskId }}'
Posts a comment in a given Asana Task
Required Asana public access token
Required Id of the task to write the comment on.
Required Comment to be posted.
Required Is the comment pinned or not.
on:
pull_request_review:
types: [submitted]
jobs:
test-job:
runs-on: ubuntu-latest
steps:
- name: Add Approved Comment to Asana Task
if: github.event.review.state == 'approved'
uses: ./actions
id: post-comment-pr-approved
with:
action: 'post-comment-asana-task'
asana-pat: ${{ secrets.asana_pat }}
asana-task-id: ${{ steps.find-asana-task-id.outputs.asanaTaskId }}
asana-task-comment: 'PR: ${{ github.event.pull_request.html_url }} has been approved.'
asana-task-comment-pinned: true
Run once: npm i -g @vercel/ncc
Run before pushing changes: ncc build index.js