Skip to content

Commit

Permalink
ci: Update IssueOps
Browse files Browse the repository at this point in the history
  • Loading branch information
CycleBai committed Aug 3, 2024
1 parent 152e9f8 commit 9834d5b
Showing 1 changed file with 51 additions and 11 deletions.
62 changes: 51 additions & 11 deletions .github/workflows/issueops.yml
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
Expand All @@ -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

0 comments on commit 9834d5b

Please sign in to comment.