File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -455,6 +455,32 @@ While these outputs are returned with certain Slack API methods:
455455- `ts` : ` string` . The timestamp of the Slack event.
456456- `thread_ts` : ` string` . The timestamp of a Slack message.
457457
458+ # ## Example responses
459+
460+ The following snippet shows how multiple steps can be chained together to create
461+ a Slack channel before posting a message :
462+
463+ ` ` ` yaml
464+ - name: Create a new Slack channel for recent changes
465+ id: conversation
466+ uses: ./
467+ with:
468+ method: conversations.create
469+ token: ${{ secrets.SLACK_BOT_TOKEN }}
470+ payload: |
471+ name: pull-request-review-${{ github.sha }}
472+
473+ - name: Send the pull request link into the Slack channel
474+ if: ${{ steps.conversation.outputs.ok }}
475+ uses: ./
476+ with:
477+ method: chat.postMessage
478+ token: ${{ secrets.SLACK_BOT_TOKEN }}
479+ payload: |
480+ channel: ${{ steps.conversation.outputs.channel_id }}
481+ text: "A PR was created <!date^${{ steps.conversation.outputs.time }}^{date_num} {time_secs}|just now>: ${{ github.event.pull_request.html_url }}"
482+ ` ` `
483+
458484# # License
459485
460486This project is licensed under the [MIT license](LICENSE).
You can’t perform that action at this time.
0 commit comments