Repository navigation
108 lines (92 loc) · 2.84 KB
/
Copy pathissue_helper_duplicate.yml
File metadata and controls
108 lines (92 loc) · 2.84 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: 'Issue Helper Duplicate'
on:
workflow_dispatch:
inputs:
item_id:
description: 'This Item ID'
type: string
required: true
orig_id:
description: 'Original Item ID'
type: string
required: true
permissions:
issues: write
concurrency:
group: lock
jobs:
# Misc Issue Items
issue_duplicate1:
name: Issue - Duplicate1
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
ISSUE_NUMBER: ${{ github.event.inputs.item_id }}
steps:
- id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- id: issueduplicate_03
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
ORIG_ID: ${{ github.event.inputs.orig_id }}
run: |
{
echo "This item is a duplicate of one or more existing items"
echo ""
echo "Please refer to Item #${ORIG_ID}."
} > comment-body.md
gh issue comment "$ISSUE_NUMBER" --body-file comment-body.md
issue_duplicate2:
name: Issue - Duplicate2
needs: [issue_duplicate1]
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
ISSUE_NUMBER: ${{ github.event.inputs.item_id }}
steps:
- id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- id: issueduplicate_04
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh issue edit "$ISSUE_NUMBER" --add-label 'Duplicate'
issue_duplicate3:
name: Issue - Duplicate3
needs: [issue_duplicate2]
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
ISSUE_NUMBER: ${{ github.event.inputs.item_id }}
steps:
- id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- id: issueduplicate_05
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh issue edit "$ISSUE_NUMBER" --remove-label 'Triage,No-Log,Queries,Parked,Prorogued,Unclear,Uncertain'
issue_duplicate4:
name: Issue - Duplicate4
needs: [issue_duplicate3]
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
ISSUE_NUMBER: ${{ github.event.inputs.item_id }}
steps:
- id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- id: issueduplicate_06
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh issue close "$ISSUE_NUMBER" --reason "completed"