two json workflow samples
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
new_push_job:
|
||||
runs-on: ubuntu-latest
|
||||
name: New push to repo
|
||||
steps:
|
||||
- name: Send GitHub trigger payload to Slack Workflow Builder
|
||||
id: slack
|
||||
uses: slackapi/[email protected]
|
||||
with:
|
||||
channel-id: 'SLACK_CHANNEL_ID' # ID of Slack Channel you want to post to
|
||||
payload: "{\"text\":\"posting from a github action\"}"
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
@@ -0,0 +1,47 @@
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
new_push_job:
|
||||
runs-on: ubuntu-latest
|
||||
name: New push to repo
|
||||
steps:
|
||||
- name: Send GitHub trigger payload to Slack Workflow Builder
|
||||
id: slack
|
||||
uses: slackapi/[email protected]
|
||||
with:
|
||||
channel-id: 'SLACK_CHANNEL_ID' # ID of Slack Channel you want to post to
|
||||
payload: |
|
||||
{
|
||||
"blocks": [
|
||||
{ "type": "divider" },
|
||||
{
|
||||
"type": "image",
|
||||
"title": {
|
||||
"type": "plain_text",
|
||||
"text": "Slack Slack Slack",
|
||||
"emoji": true
|
||||
},
|
||||
"image_url": "https://media.makeameme.org/created/a-slack-this.jpg",
|
||||
"alt_text": "marg"
|
||||
},
|
||||
{
|
||||
"type": "actions",
|
||||
"elements": [
|
||||
{
|
||||
"type": "button",
|
||||
"text": {
|
||||
"type": "plain_text",
|
||||
"text": $values.button_text
|
||||
},
|
||||
"url": $values.button_url
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
channel-id": "NEW_TARGET_CHANNEL_ID"
|
||||
}
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
values: |
|
||||
button_text: ${{ github.sha }}
|
||||
button_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
Reference in New Issue
Block a user