Bin
2025-12-16 9e0b2ba2c317b1a86212f24cbae3195ad1f3dbfa
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
33
34
35
name: "ZenDesk: Close GitHub Issue on Zendesk Ticket Solved"
 
on:
  workflow_dispatch:
    inputs:
      external_id:
        description: "GitHub issue url"
        required: true
        type: string
 
jobs:
  close_issue:
    runs-on: ubuntu-latest
    steps:
      - uses: hmarr/debug-action@v3.0.0
 
      - uses: actions/github-script@v8
        with:
          github-token: ${{ secrets.GIT_PAT_HEIDI }}
          script: |
            // Extract issue details from the Zendesk external_id
            const parts = context.payload.inputs.external_id.split("/");
            const issue_number = parts[parts.length - 1];
            const issue_repo = parts[parts.length - 3];
            const issue_owner = parts[parts.length - 4];
 
            // Close the GitHub issue
            const { data: issue } await github.rest.issues.update({
              owner: issue_owner,
              repo: issue_repo,
              issue_number: issue_number,
              state: "closed"
            });
 
            core.info(`GitHub issue ${issue.html_url} closed successfully.`);