Skip to content

Unusual employee's API response #86

Unusual employee's API response

Unusual employee's API response #86

Workflow file for this run

name: Add JSON comment
on:
issues:
types: [labeled]
jobs:
add-comment:
if: github.event.label.name == 'parsing'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create comment body
env:
ISSUE_BODY: ${{ github.event.issue.body }}
run: |
API_URL=$(echo $ISSUE_BODY | grep -Eo "https://iis.bsuir.by/[a-zA-Z0-9./?=_%:-]*")
API_RESPONSE=$(curl $API_URL)
cat > comment-body.md<< EOF
**This comment was generated by bot 🤖**
### Fetched
\`${API_URL}\`
### Response
\`\`\`json
${API_RESPONSE}
\`\`\`
EOF
- name: Add comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.issue.number }}
body-file: 'comment-body.md'