-
Notifications
You must be signed in to change notification settings - Fork 66
129 lines (110 loc) · 3.42 KB
/
issue_helper_duplicate.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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: 'Issue Helper Duplicate'
on:
workflow_dispatch:
inputs:
item_id:
description: 'This Item ID'
required: true
orig_id:
description: 'Original Item ID'
required: true
permissions:
issues: write
concurrency:
group: lock
jobs:
# Misc Issue Items - https://github.com/actions-cool/issues-helper
issue_duplicate1:
name: Issue - Duplicate1
runs-on: ubuntu-24.04
steps:
- id: issueduplicate_01
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueNumber = context.payload.inputs.orig_id;
const { data } = await github.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber
});
if (data.locked) {
console.log("::set-output name=islocked::true");
} else {
console.log("::set-output name=islocked::false");
}
issue_duplicate2:
name: Issue - Duplicate2
needs: [issue_duplicate1]
runs-on: ubuntu-24.04
steps:
- id: issueduplicate_02
uses: actions-cool/issues-helper@v3
with:
actions: 'unlock-issue'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.inputs.orig_id }}
issue_duplicate3:
name: Issue - Duplicate3
needs: [issue_duplicate2]
runs-on: ubuntu-24.04
steps:
- id: issueduplicate_03
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.inputs.item_id }}
body: |
This item is a duplicate of one or more existing items
Please refer to Item #${{ github.event.inputs.orig_id }}.
issue_duplicate4:
name: Issue - Duplicate4
needs: [issue_duplicate3]
runs-on: ubuntu-24.04
steps:
- id: issueduplicate_04
uses: actions-cool/issues-helper@v3
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.inputs.item_id }}
labels: 'Duplicate'
issue_duplicate5:
name: Issue - Duplicate5
needs: [issue_duplicate4]
runs-on: ubuntu-24.04
steps:
- id: issueduplicate_05
uses: actions-cool/issues-helper@v3
with:
actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.inputs.item_id }}
labels: 'Triage,Queries,Parked,Prorogued,Unclear,Uncertain'
issue_duplicate6:
name: Issue - Duplicate6
needs: [issue_duplicate5]
runs-on: ubuntu-24.04
steps:
- id: issueduplicate_06
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issue'
close-reason: 'completed'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.inputs.item_id }}
issue_duplicate7:
name: Issue - Duplicate7
needs: [issue_duplicate6]
runs-on: ubuntu-24.04
if: ${{ steps.issueduplicate_01.outputs.islocked == 'true' }}
steps:
- id: issueduplicate_07
uses: actions-cool/issues-helper@v3
with:
actions: 'lock-issue'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.inputs.orig_id }}
issue-state: 'closed'