github-project-automation-plus
github-project-automation-plus copied to clipboard
Project board column change
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.
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?
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.
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 }}"