-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
51 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
name: "IssueOps" | ||
|
||
# the workflow to execute on is comments that are newly created | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
# permissions needed for reacting to IssueOps commands on issues and PRs | ||
permissions: | ||
pull-requests: write | ||
issues: write | ||
|
@@ -15,17 +13,59 @@ jobs: | |
ping: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# execute IssueOps command logic, hooray! | ||
# this will be used to "gate" all future steps below | ||
- uses: github/command@main | ||
id: command | ||
with: | ||
command: ".ping" | ||
command: ".ping_staff" | ||
allowed_contexts: "pull_request,issue" | ||
reaction: "eyes" | ||
|
||
# run your custom logic for your project here - example seen below | ||
|
||
# conditionally run some logic here | ||
- name: ping | ||
if: ${{ steps.command.outputs.continue == 'true' }} | ||
run: echo "success" | ||
- name: Send custom JSON data to Slack workflow | ||
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 }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Issue/PR* \n ${{ github.event.comment.id }}" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Github Link:" | ||
}, | ||
"accessory": { | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Click Me" | ||
}, | ||
"value": "link", | ||
"url": "${{ github.event.comment.issue_url }}", | ||
"action_id": "button-action" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |