Add dice2 -> test automation #5
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: Submit Verification Request | |
on: | |
issue_comment: | |
types: [created, edited] | |
jobs: | |
submit: | |
if: ${{ github.event.issue.pull_request }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
if: contains(github.event.comment.body, '/verify') | |
with: | |
node-version: 16 | |
- uses: actions/github-script@v6 | |
id: process-comment | |
with: | |
script: | | |
const body = github.event.comment.body | |
const result = body.split[" "][1] | |
console.log(result) | |
- uses: actions/checkout@v3 | |
- name: Install Packages | |
run: yarn --cwd ./scripts install --frozen-lockfile | |
- name: Submit Request to Discord | |
run: node --no-warnings ./scripts/verify/index.js | |
env: | |
DISCORD_VERIFY_WEBHOOK: ${{ secrets.DISCORD_VERIFY_WEBHOOK }} | |
EXTENSION_KEY: ${{ steps.process-comment.outputs.result }} | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Verification has been submitted' | |
}) |