add-to-project icon indicating copy to clipboard operation
add-to-project copied to clipboard

Add Support for Assign and Unassign Event Types

Open brian-hayward opened this issue 2 years ago • 2 comments

Thank you so much for this action, it saves our team a lot of time needing to add issues to our issues board manually.

Could you consider adding assigned and unassigned as supported action event types? We like to automatically update the status on issues if it has been assigned or unassigned. For example, if an issue is opened by our Support team without an owner assigned, and then engineer X assigns themself as the owner, we like to automatically move that issue to "In Progress". Reversely, if they remove themself from being owner such that there are no owners, we would move it back to being "Open".

brian-hayward avatar Aug 09 '22 09:08 brian-hayward

@brian-hayward I haven't had a chance to test this yet but this may already work. Have you tried configuring your workflow with assigned/unassigned event types?

skw avatar Aug 10 '22 18:08 skw

Do this...

on:
  issues:
    types: [labeled, assigned]

jobs:
  assigned_job_beta:
    if: github.event.action == 'assigned' 
    runs-on: ubuntu-latest
    name: Add issue to project (beta)
    steps:
    - name: "Add issue that have been assigned to austenstone to project board"
      uses: actions/[email protected]
      if: contains(github.event.issue.assignees.*.login, 'austenstone')
      with:
        github-token: ${{ secrets.AUSTENSTONE_ORG_REPO_TOKEN }}
        project-url: https://github.com/orgs/github/projects/5380

or

if: github.event.action == 'assigned' && contains(github.event.issue.assignees.*.login, 'austenstone')

austenstone avatar Aug 12 '22 16:08 austenstone