-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1.17 KB
/
zendesk_github_ticket_solved.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: On Zendesk ticket solved
on:
repository_dispatch:
types:
- zendesk_github_ticket_solved
jobs:
trigger-close-issue-workflow:
name: Trigger close issue workflow
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v5
id: repo-set
with:
result-encoding: string
script: |
// get client payload
payload = context.payload.client_payload
// split external id to get owner, repo and issue number
parts = payload.ticket.external_id.split("/")
$issue_repo = parts[parts.length - 3]
$issue_owner = parts[parts.length - 4]
return $issue_owner + "/" + $issue_repo
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@c73dcc42429d4220d60b2b8daf3cee190a131129
if: ${{ startsWith(steps.repo-set.outputs.result, format('{0}/', github.repository_owner)) }}
with:
token: ${{ secrets.GH_ZENDESK_INVOKE_WORKFLOW_TOKEN }}
repository: ${{ steps.repo-set.outputs.result }}
event-type: zendesk_github_close_issue
client-payload: ${{ toJson(github.event.client_payload) }}