-
-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (65 loc) · 2.24 KB
/
manual-test.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
name: Manual Issue Transer Action Test
on:
issues:
types:
- labeled
jobs:
test-action:
runs-on: ${{ matrix.os }}
env:
TERM: xterm
strategy:
matrix:
os:
- ubuntu-20.04
router:
- manual_issue_transfer_action_test:transfer-issue-action
- holla-tronic:transfer-issue-action
steps:
- uses: actions/checkout@v3
- name: Manual Action Test
id: test_action
uses: ./
with:
token: ${{ secrets.TRANSFER_ISSUE_TOKEN }}
router: ${{ matrix.router }}
apply_label: MANUAL ACTION TEST
debug: true
- name: Echo Output Data
run: |
echo "DESTINATION REPO: ${{steps.test_action.outputs.destination_repo}}"
echo "NEW ISSUE NUMBER: ${{steps.test_action.outputs.new_issue_number}}"
echo "NEW ISSUE URL: ${{steps.test_action.outputs.new_issue_url}}"
echo "STUB ISSUE NUMBER: ${{steps.test_action.outputs.stub_issue_number}}"
- name: Comment on transferred issue
if: steps.test_action.outputs.new_issue_number != ''
uses: actions/github-script@v5
with:
debug: true
script: |
try {
await github.rest.issues.createComment({
issue_number: '${{steps.test_action.outputs.new_issue_number}}',
owner: context.repo.owner,
repo: '${{steps.test_action.outputs.destination_repo}}',
body: 'Comment to verify manual action test. The issue will now automatically be closed.'
});
} catch (error) {
core.setFailed(error.message);
}
- name: Close transferred issue
if: steps.test_action.outputs.new_issue_number != ''
uses: actions/github-script@v5
with:
debug: true
script: |
try {
await github.rest.issues.update({
issue_number: '${{steps.test_action.outputs.new_issue_number}}',
owner: context.repo.owner,
repo: '${{steps.test_action.outputs.destination_repo}}',
state: 'closed'
});
} catch (error) {
core.setFailed(error.message);
}