From 79ced8d7ff84cb117462b9bbbb7c27d972fc1478 Mon Sep 17 00:00:00 2001 From: Pete Inge Date: Sun, 15 Sep 2024 13:45:13 -0400 Subject: [PATCH] Testing a few more things --- .github/workflows/testing-slack.yml | 79 +++++++++++++++++++++++++---- message.md | 6 +++ 2 files changed, 76 insertions(+), 9 deletions(-) create mode 100644 message.md diff --git a/.github/workflows/testing-slack.yml b/.github/workflows/testing-slack.yml index 48a8916d..c20696c1 100644 --- a/.github/workflows/testing-slack.yml +++ b/.github/workflows/testing-slack.yml @@ -134,7 +134,7 @@ jobs: const fs = require("fs-extra"); const filePath = "./payload.json"; const json = fs.readJSONSync(filePath); - json.blocks[3].elements[1].elements[1].elements[0].name = "green_circle"; + json.blocks[3].elements[1].elements[1].elements[0].name = "large_green_circle"; fs.writeJSONSync(filePath, json, { spaces: 2 }); ' @@ -154,15 +154,21 @@ jobs: env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - - name: update payload + # - name: update payload + # run: | + # node -e ' + # const fs = require("fs-extra"); + # const filePath = "./payload.json"; + # const json = fs.readJSONSync(filePath); + # json.blocks[3].elements[1].elements[2].elements[0].name = "large_green_circle"; + # fs.writeJSONSync(filePath, json, { spaces: 2 }); + # ' + + - name: Check jq run: | - node -e ' - const fs = require("fs-extra"); - const filePath = "./payload.json"; - const json = fs.readJSONSync(filePath); - json.blocks[3].elements[1].elements[2].elements[0].name = "green_circle"; - fs.writeJSONSync(filePath, json, { spaces: 2 }); - ' + jq '.blocks[3].elements[1].elements[2].elements[0].name = "large_green_circle"' payload.json > temp.json + mv -- temp.json payload.json + rm -f -- temp.json - uses: slackapi/slack-github-action@v1.27.0 with: @@ -216,3 +222,58 @@ jobs: } env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + + + reply_2: + runs-on: ubuntu-latest + needs: initial_msg + steps: + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.head_ref || github.ref_name }} + + - uses: qoomon/actions--context@v2 + id: context + + - name: Messages to env var + if: ${{ env.SHOULD_BUILD_JOB == 'true' && env.PR_NUMBER != 0 }} + run: | + # (echo "MESSAGE_MD_VAR=$(cat message.md)") >> "$GITHUB_ENV" + MARKDOWN_CONTENTS=$(cat message.md) + MARKDOWN_CONTENTS=${MARKDOWN_CONTENTS//$'\r\n'/} + echo "MARKDOWN_CONTENTS<> $GITHUB_ENV + echo "$MARKDOWN_CONTENTS" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - uses: slackapi/slack-github-action@v1.27.0 + with: + channel-id: "C07MUHXPX97" + payload: | + { + "thread_ts": "${{ needs.initial_msg.outputs.slack_msg_ts }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "" + }, + "accessory": { + "type": "button", + "text": { + "type": "plain_text", + "text": "Results", + "emoji": true + }, + "value": "phpstan_results", + "url": "${{ steps.context.outputs.job_log_url }}", + "action_id": "button-action" + } + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/message.md b/message.md new file mode 100644 index 00000000..23eef7a6 --- /dev/null +++ b/message.md @@ -0,0 +1,6 @@ +## 📝 BackstopJS Report: + + +❌ **Visual regression test failed!** + +[VR Report](https://live-connect-bluecadet.pantheonsite.io/sites/default/files/vis-reg-reports/20240914-203232/artifacts/backstop_data/html_report/index.html)