-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Asana automation workflow * fix: don't run if it's a Dependabot PR * fix: rename to .yml * chore: bump Action versions * fix: 1.0.5 not allowed * fix: change required inputs and secrets * feat: move to in review when review requested * feat: use MBTA Asana action * feat: add option for marking merged PRs as complete * feat: make asana GitHub token optional * docs: clarify required secrets * fix: default complete-on-merge to false * fix: make attaching PR optional * feat: make trigger configurable * docs: describe secrets
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
merged-section: | ||
type: string | ||
required: false | ||
description: The Asana project section for tickets with PRs that have been merged. Requires secrets.asana-token. | ||
review-section: | ||
type: string | ||
required: false | ||
description: The Asana project section for tickets with PRs that have a review requested. Requires secrets.asana-token. | ||
complete-on-merge: | ||
type: boolean | ||
default: false | ||
description: Whether to mark tasks for merged PRs as complete. Requires secrets.asana-token. | ||
attach-pr: | ||
type: boolean | ||
default: false | ||
description: Whether to attach the PR to the Asana ticket. Requires secrets.asana-github-secret. | ||
trigger-phrase: | ||
type: string | ||
default: "\\*\\*Asana Ticket:\\*\\*" | ||
description: Phrase to trigger moving ticket between columns. | ||
secrets: | ||
asana-token: | ||
required: false | ||
description: Asana personal access token that GitHub Actions uses to move ticket between sections. | ||
github-secret: | ||
required: false | ||
description: GitHub secret that Asana uses to fetch PR information. | ||
jobs: | ||
move-to-merged-asana-ticket-job: | ||
runs-on: ubuntu-latest | ||
if: inputs.merged-section != '' && github.event.pull_request.merged == true && github.actor != 'dependabot[bot]' | ||
steps: | ||
- name: Move ticket on merge | ||
uses: mbta/[email protected] | ||
with: | ||
asana-pat: ${{ secrets.asana-token }} | ||
trigger-phrase: ${{ inputs.trigger-phrase }} | ||
target-section: ${{ inputs.merged-section }} | ||
mark-complete: ${{ inputs.complete-on-merge }} | ||
move-to-in-review-asana-ticket-job: | ||
runs-on: ubuntu-latest | ||
if: inputs.review-section != '' && github.event.action == 'review_requested' && github.actor != 'dependabot[bot]' | ||
steps: | ||
- name: Move ticket on review requested | ||
uses: mbta/[email protected] | ||
with: | ||
asana-pat: ${{ secrets.asana-token }} | ||
trigger-phrase: ${{ inputs.trigger-phrase }} | ||
target-section: ${{ inputs.review-section }} | ||
create-asana-attachment-job: | ||
runs-on: ubuntu-latest | ||
name: Create pull request attachments on Asana tasks | ||
if: inputs.attach-pr && github.actor != 'dependabot[bot]' | ||
steps: | ||
- name: Create pull request attachments | ||
uses: Asana/[email protected] | ||
id: postAttachment | ||
with: | ||
asana-secret: ${{ secrets.asana-github-secret }} | ||
- name: Log output status | ||
run: echo "Status is ${{ steps.postAttachment.outputs.status }}" |