Lucas staging com #359
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
name: Discord Webhook | |
on: | |
pull_request: | |
paths: | |
- 'packages/UI/.storybook/**' | |
- 'packages/UI/src/**' | |
jobs: | |
discord: | |
runs-on: ubuntu-latest | |
outputs: | |
url: ${{ steps.chromatic.outputs.url }} | |
buildUrl: ${{ steps.chromatic.outputs.buildUrl }} | |
storybookUrl: ${{ steps.chromatic.outputs.storybookUrl }} | |
branch: ${{ steps.extract_branch.outputs.branch }} | |
pr_number: ${{ steps.extract_pr_number.outputs.pr_number }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=$(echo "${{ github.event.pull_request.head.ref }}" | tr / -)" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Extract PR number | |
shell: bash | |
run: echo "pr_number=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_OUTPUT | |
id: extract_pr_number | |
- name: Discord Channel Notification | |
env: | |
BRANCH: ${{ steps.extract_branch.outputs.branch }} | |
URL: ${{ steps.deploy.outputs.url }} | |
DISCORD_WEBHOOK: ${{ secrets.UI_BUILDS_WEBHOOK }} | |
DISCORD_EMBEDS: '[{"title": "Chromatic","description": "View the Chromatic review.","url": "https://www.chromatic.com/pullrequest?appId=632ca21aeea1618b7fa0bf48&number=${{ steps.extract_pr_number.outputs.pr_number }}"}, {"title": "Storybook","description": "View the storybook for this change.","url": "https://${{ steps.extract_branch.outputs.branch }}--632ca21aeea1618b7fa0bf48.chromatic.com/"}]' | |
uses: Ilshidur/action-discord@master | |
with: | |
args: 'New build for ${{ steps.extract_branch.outputs.branch }} has finished. ${{ github.event.head_commit.author.name }} has made changes with the following commit message: ${{ github.event.pull_request.head_commit.message }}' |