Transfer Issue Action Test Issue #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |