resource-published #1351
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
on: | |
repository_dispatch: | |
types: | |
- resource-published | |
jobs: | |
print: | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
echo "Status: ${{ github.event.client_payload.status }}" | |
echo "Path: ${{ github.event.client_payload.path }}" | |
slack: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Format path | |
id: format | |
uses: frabert/replace-string-action@v2 | |
with: | |
pattern: '\.md' | |
string: ${{ github.event.client_payload.path }} | |
replace-with: '' | |
- name: Notify Slack (JSON) | |
if: ${{ endsWith(github.event.client_payload.path, '.json') }} | |
uses: slackapi/slack-github-action@v1.23.0 | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
with: | |
# For posting a rich message using Block Kit | |
payload: | | |
{ | |
"text": "Just published: `${{ github.event.client_payload.path }}`" | |
} | |
- name: Notify Slack (Markdown) | |
if: ${{ endsWith(github.event.client_payload.path, '.md') }} | |
uses: slackapi/slack-github-action@v1.23.0 | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
with: | |
# For posting a rich message using Block Kit | |
payload: | | |
{ | |
"text": "Just published: https://www.aem.live${{ steps.format.outputs.replaced }}" | |
} |