github-project-automation-plus icon indicating copy to clipboard operation
github-project-automation-plus copied to clipboard

Project board column change

Open woodie opened this issue 5 years ago • 3 comments

If we want to sync our Github project board with external systems, it would be helpful to have a way to trigger actions when an Issue is dragged from one column to another.

woodie avatar Jul 30 '20 07:07 woodie

I want to keep this action simple and focused on the issue and pull request webhooks. I could expand it to use column webhooks. This would address this need. Would you be interested in helping adding this functionality?

alex-page avatar Jul 30 '20 12:07 alex-page

This is awesome, thanks @woodie. I don't have time right now to implement this but the details here are really awesome. If you want to make a PR I can definitely review it.

alex-page avatar Aug 17 '20 14:08 alex-page

Got it working with existing actions.

name: Comment on column move

on:
  project_card:
    types: [moved]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Fetch card properties
        uses: JamesIves/fetch-api-data-action@releases/v1
        with:
          ENDPOINT: ${{ github.event.project_card.url }}
          CONFIGURATION: |
            { "method": "GET",
              "headers": {
                "Authorization": "Bearer ${{ secrets.AUTOMATION_TOKEN }}",
                "Accept": "application/vnd.github.inertia-preview+json"
              }
            }
      - name: Parse content URL
        uses: jungwinter/split@v1
        id: split
        with:
          msg: ${{ fromJson(env['FETCH_API_DATA']).content_url }}
          seperator: '/'
      - name: Fetch column properties
        uses: JamesIves/fetch-api-data-action@releases/v1
        with:
          ENDPOINT: ${{ github.event.project_card.column_url }}
          CONFIGURATION: |
            { "method": "GET",
              "headers": {
                "Authorization": "Bearer ${{ secrets.AUTOMATION_TOKEN }}",
                "Accept": "application/vnd.github.inertia-preview+json"
              }
            }
      - name: Create comment
        if: ${{ steps.split.outputs._6 == 'issues' }}
        uses: peter-evans/create-or-update-comment@v1
        with:
          issue-number: ${{ steps.split.outputs._7 }}
          body: "@${{ github.event.sender.login }} moved Issue to ${{ fromJson(env['FETCH_API_DATA']).name }}"

woodie avatar Aug 21 '20 00:08 woodie