test #10
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: "IssueOps" | |
on: | |
issue_comment: | |
types: [created] | |
permissions: | |
pull-requests: write | |
issues: write | |
checks: read | |
jobs: | |
ping: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: github/command@main | |
id: command | |
with: | |
command: ".ping_staff" | |
allowed_contexts: "pull_request,issue" | |
reaction: "eyes" | |
- name: Send custom JSON data to Slack workflow | |
if: ${{ steps.command.outputs.continue == 'true' }} | |
id: slack | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "# Mentioned - Urgent Processing" | |
} | |
}, | |
{ | |
"type": "section", | |
"fields": [ | |
{ | |
"type": "mrkdwn", | |
"text": "*User* \n ${{ github.event.comment.user.name }}" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*Issue/PR* \n #${{ github.event.issue.number }}" | |
} | |
] | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Github Link:" | |
}, | |
"accessory": { | |
"type": "button", | |
"text": { | |
"type": "plain_text", | |
"text": "Click Me" | |
}, | |
"value": "link", | |
"url": "${{ github.event.comment.html_url }}", | |
"action_id": "button-action" | |
} | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
- name: Add comment | |
if: ${{ steps.command.outputs.continue == 'true' }} | |
run: gh issue comment "$NUMBER" --body "$BODY" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_REPO: ${{ github.repository }} | |
NUMBER: ${{ github.event.issue.number }} | |
BODY: > | |
Success. | |
When using Ping Staff, please make sure you abide by our Code of Conduct. | |
Also remember that this project is maintained by the open source community, and Zeeker and the related team only maintain it and have no obligation to answer your questions. | |
Before asking questions, reading http://www.catb.org/~esr/faqs/smart-questions.html will save you and us a lot of unnecessary trouble. | |
> *I am a robot and this action was performed automatically.* |