From d50c7d3a17a8273c80238cd8f9417365e396336d Mon Sep 17 00:00:00 2001 From: Brianna Morales Date: Wed, 9 Sep 2026 13:02:24 -0700 Subject: [PATCH 1/7] Update push and pr notification to use cardsv2 --- .github/workflows/pr_notification.yml | 140 +++++++++++------------- .github/workflows/push_notification.yml | 110 +++++++++++-------- 2 files changed, 125 insertions(+), 125 deletions(-) diff --git a/.github/workflows/pr_notification.yml b/.github/workflows/pr_notification.yml index fd532fb1..276e9e5b 100644 --- a/.github/workflows/pr_notification.yml +++ b/.github/workflows/pr_notification.yml @@ -8,88 +8,72 @@ jobs: notify-pull-request: runs-on: ubuntu-latest steps: - - name: Pull Request Details - run: | - echo "Pull Request: ${{ github.event.pull_request.number }}" - echo "Author: ${{ github.event.pull_request.user.login }}" + - name: Pull Request Details + run: | + echo "Pull Request: ${{ github.event.pull_request.number }}" + echo "Author: ${GITHUB_EVENT_PULL_REQUEST_USER_LOGIN}" + env: + GITHUB_EVENT_PULL_REQUEST_USER_LOGIN: ${{ github.event.pull_request.user.login }} - - name: Google Chat Notification - shell: bash - env: - TITLE: ${{ github.event.pull_request.title }} - LABELS: ${{ join(github.event.pull_request.labels.*.name, ', ') }} - run: | - curl --location --request POST '${{ secrets.WEBHOOK_URL }}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ - "cards": [ - { - "header": { - "title": "Pull request notification", - "subtitle": "Pull request: #${{ github.event.pull_request.number }}" - }, - "sections": [ + - name: Google Chat Notification + shell: bash + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + TITLE: ${{ github.event.pull_request.title }} + LABELS: ${{ join(github.event.pull_request.labels.*.name, ', ') }} + URL: ${{ github.event.pull_request.html_url }} + run: | + PAYLOAD=$(jq -n \ + --arg pr_num "$PR_NUMBER" \ + --arg title "$TITLE" \ + --arg labels "$LABELS" \ + --arg url "$URL" \ + '{ + cardsV2: [ { - "widgets": [ - { - "keyValue": { - "topLabel": "Repo", - "content": "${{ github.event.pull_request.head.repo.full_name }}" - } - }, - { - "keyValue": { - "topLabel": "Title", - "content": "'"$TITLE"'" - } - }, - { - "keyValue": { - "topLabel": "Creator", - "content": "${{ github.event.pull_request.user.login }}" - } - }, - { - "keyValue": { - "topLabel": "State", - "content": "${{ github.event.pull_request.state }}" - } - }, - { - "keyValue": { - "topLabel": "Assignees", - "content": "- ${{ join(github.event.pull_request.assignees.*.login, ', ') }}" - } + cardId: "prNotificationCard", + card: { + header: { + title: "Pull request notification", + subtitle: ("Pull request: #" + $pr_num) }, - { - "keyValue": { - "topLabel": "Reviewers", - "content": "- ${{ join(github.event.pull_request.requested_reviewers.*.login, ', ') }}" - } - }, - { - "keyValue": { - "topLabel": "Labels", - "content": "- '"$LABELS"'" - } - }, - { - "buttons": [ - { - "textButton": { - "text": "Open Pull Request", - "onClick": { - "openLink": { - "url": "${{ github.event.pull_request.html_url }}" - } + sections: [ + { + widgets: [ + { + decoratedText: { + topLabel: "Title", + text: $title + } + }, + { + decoratedText: { + topLabel: "Labels", + text: (if $labels != "" then $labels else "None" end) + } + }, + { + buttonList: { + buttons: [ + { + text: "Open Pull Request", + onClick: { + openLink: { + url: $url + } + } + } + ] } } - } - ] - } - ] + ] + } + ] + } } ] - } - ] - }' + }') + + curl --location --request POST '${{ secrets.WEBHOOK_URL }}' \ + --header 'Content-Type: application/json; charset=UTF-8' \ + --data "$PAYLOAD" diff --git a/.github/workflows/push_notification.yml b/.github/workflows/push_notification.yml index 1dc3ce1a..0a1a5f5e 100644 --- a/.github/workflows/push_notification.yml +++ b/.github/workflows/push_notification.yml @@ -8,59 +8,75 @@ on: jobs: notify-push-main: runs-on: ubuntu-latest - env: - COMMIT: ${{ github.event.head_commit.message }} steps: - - name: Main Branch Push - run: | - echo "Workflow initiated by event with name: ${{ github.event_name }}" - echo "Pushing commit to main: ${{ github.event.head_commit.id }}" - echo "Pushed by: ${{ github.event.pusher.name }}" + - name: Main Branch Push + run: | + echo "Workflow initiated by event with name: ${{ github.event_name }}" + echo "Pushing commit to main: ${GITHUB_EVENT_HEAD_COMMIT_ID}" + echo "Pushed by: ${GITHUB_EVENT_PUSHER_NAME}" + env: + GITHUB_EVENT_HEAD_COMMIT_ID: ${{ github.event.head_commit.id }} + GITHUB_EVENT_PUSHER_NAME: ${{ github.event.pusher.name }} - - name: Push Notification to Google Chat - run: | - curl --location --request POST '${{ secrets.WEBHOOK_URL }}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ - "cards": [ - { - "header": { - "title": "Push to main branch", - "subtitle": "'"$COMMIT"'" - }, - "sections": [ + - name: Push Notification to Google Chat + shell: bash + env: + COMMIT_MSG: ${{ github.event.head_commit.message }} + AUTHOR: ${{ github.event.head_commit.author.username }} + REPO: ${{ github.event.repository.full_name }} + COMPARE_URL: ${{ github.event.compare }} + run: | + PAYLOAD=$(jq -n \ + --arg commit "$COMMIT_MSG" \ + --arg author "$AUTHOR" \ + --arg repo "$REPO" \ + --arg compare "$COMPARE_URL" \ + '{ + cardsV2: [ { - "widgets": [ - { - "keyValue": { - "topLabel": "Repo", - "content": "${{ github.event.repository.full_name }}" - } - }, - { - "keyValue": { - "topLabel": "Committed by", - "content": "${{ github.event.head_commit.author.username }}" - } + cardId: "pushNotificationCard", + card: { + header: { + title: "Push to main branch", + subtitle: $commit }, - { - "buttons": [ - { - "textButton": { - "text": "Ref comparison", - "onClick": { - "openLink": { - "url": "${{ github.event.compare }}" - } + sections: [ + { + widgets: [ + { + decoratedText: { + topLabel: "Repo", + text: $repo + } + }, + { + decoratedText: { + topLabel: "Committed by", + text: $author + } + }, + { + buttonList: { + buttons: [ + { + text: "Ref comparison", + onClick: { + openLink: { + url: $compare + } + } + } + ] } } - } - ] - } - ] + ] + } + ] + } } ] - } - ] - }' + }') + curl --location --request POST '${{ secrets.WEBHOOK_URL }}' \ + --header 'Content-Type: application/json; charset=UTF-8' \ + --data "$PAYLOAD" From 5ab3abdcb5887066d80d7c3cd22a06bcb1947d0f Mon Sep 17 00:00:00 2001 From: Brianna Morales <74382627+brnnmrls@users.noreply.github.com> Date: Wed, 9 Sep 2026 13:59:21 -0700 Subject: [PATCH 2/7] Update pr_notification.yml to fix actions workflow --- .github/workflows/pr_notification.yml | 136 +++++++++++--------------- 1 file changed, 59 insertions(+), 77 deletions(-) diff --git a/.github/workflows/pr_notification.yml b/.github/workflows/pr_notification.yml index 447a8bbd..3ced031b 100644 --- a/.github/workflows/pr_notification.yml +++ b/.github/workflows/pr_notification.yml @@ -4,89 +4,71 @@ on: pull_request: types: [review_requested] +permissions: + contents: read + jobs: notify-pull-request: runs-on: ubuntu-latest steps: - - name: Pull Request Details - run: | - echo "Pull Request: ${{ github.event.pull_request.number }}" - echo "Author: ${GITHUB_EVENT_PULL_REQUEST_USER_LOGIN}" - env: - GITHUB_EVENT_PULL_REQUEST_USER_LOGIN: ${{ github.event.pull_request.user.login }} + - name: Pull Request Details + run: | + echo "Pull Request: ${PR_NUMBER}" + echo "Author: ${AUTHOR}" + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + AUTHOR: ${{ github.event.pull_request.user.login }} - - name: Google Chat Notification - shell: bash - env: - TITLE: ${{ github.event.pull_request.title }} - LABELS: ${{ join(github.event.pull_request.labels.*.name, ', ') }} - GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }} - GITHUB_EVENT_PULL_REQUEST_USER_LOGIN: ${{ github.event.pull_request.user.login }} - GITHUB_EVENT_PULL_REQUEST_HTML_URL: ${{ github.event.pull_request.html_url }} - run: | - curl --location --request POST '${{ secrets.WEBHOOK_URL }}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ - "cards": [ - { - "header": { - "title": "Pull request notification", - "subtitle": "Pull request: #${{ github.event.pull_request.number }}" - }, - "sections": [ + - name: Google Chat Notification + shell: bash + env: + WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} + PR_NUMBER: ${{ github.event.pull_request.number }} + TITLE: ${{ github.event.pull_request.title }} + LABELS: ${{ join(github.event.pull_request.labels.*.name, ', ') }} + URL: ${{ github.event.pull_request.html_url }} + run: | + PAYLOAD=$(jq -n \ + --arg pr_num "$PR_NUMBER" \ + --arg title "$TITLE" \ + --arg labels "$LABELS" \ + --arg url "$URL" \ + '{ + cardsV2: [ { - "widgets": [ - { - "keyValue": { - "topLabel": "Repo", - "content": "${GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME}" - } - }, - { - "keyValue": { - "topLabel": "Title", - "content": "'"$TITLE"'" - } - }, - { - "keyValue": { - "topLabel": "Creator", - "content": "${GITHUB_EVENT_PULL_REQUEST_USER_LOGIN}" - } - }, - { - "keyValue": { - "topLabel": "State", - "content": "${{ github.event.pull_request.state }}" - } + cardId: "prNotificationCard", + card: { + header: { + title: "Pull request notification", + subtitle: ("Pull request: #" + $pr_num) }, - { - "keyValue": { - "topLabel": "Assignees", - "content": "- ${{ join(github.event.pull_request.assignees.*.login, ', ') }}" - } - }, - { - "keyValue": { - "topLabel": "Reviewers", - "content": "- ${{ join(github.event.pull_request.requested_reviewers.*.login, ', ') }}" - } - }, - { - "keyValue": { - "topLabel": "Labels", - "content": "- '"$LABELS"'" - } - }, - { - "buttons": [ - { - "textButton": { - "text": "Open Pull Request", - "onClick": { - "openLink": { - "url": "${GITHUB_EVENT_PULL_REQUEST_HTML_URL}" - } + sections: [ + { + widgets: [ + { + decoratedText: { + topLabel: "Title", + text: $title + } + }, + { + decoratedText: { + topLabel: "Labels", + text: (if $labels != "" then $labels else "None" end) + } + }, + { + buttonList: { + buttons: [ + { + text: "Open Pull Request", + onClick: { + openLink: { + url: $url + } + } + } + ] } } ] @@ -97,6 +79,6 @@ jobs: ] }') - curl --location --request POST '${{ secrets.WEBHOOK_URL }}' \ + curl --location --request POST "$WEBHOOK_URL" \ --header 'Content-Type: application/json; charset=UTF-8' \ --data "$PAYLOAD" From 71858bd2833dd99f8035a6a49cb8da3e26bc575b Mon Sep 17 00:00:00 2001 From: Brianna Morales <74382627+brnnmrls@users.noreply.github.com> Date: Wed, 9 Sep 2026 13:59:46 -0700 Subject: [PATCH 3/7] Update push_notification.yml to fix actions workflows --- .github/workflows/push_notification.yml | 84 ++++++++++++++----------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/.github/workflows/push_notification.yml b/.github/workflows/push_notification.yml index 215d33b6..73a39fec 100644 --- a/.github/workflows/push_notification.yml +++ b/.github/workflows/push_notification.yml @@ -5,22 +5,27 @@ on: branches: - main +permissions: + contents: read + jobs: notify-push-main: runs-on: ubuntu-latest steps: - - name: Main Branch Push - run: | - echo "Workflow initiated by event with name: ${{ github.event_name }}" - echo "Pushing commit to main: ${GITHUB_EVENT_HEAD_COMMIT_ID}" - echo "Pushed by: ${GITHUB_EVENT_PUSHER_NAME}" - env: - GITHUB_EVENT_HEAD_COMMIT_ID: ${{ github.event.head_commit.id }} - GITHUB_EVENT_PUSHER_NAME: ${{ github.event.pusher.name }} + - name: Main Branch Push + run: | + echo "Workflow initiated by event with name: ${EVENT_NAME}" + echo "Pushing commit to main: ${HEAD_COMMIT_ID}" + echo "Pushed by: ${PUSHER_NAME}" + env: + EVENT_NAME: ${{ github.event_name }} + HEAD_COMMIT_ID: ${{ github.event.head_commit.id }} + PUSHER_NAME: ${{ github.event.pusher.name }} - name: Push Notification to Google Chat shell: bash env: + WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} COMMIT_MSG: ${{ github.event.head_commit.message }} AUTHOR: ${{ github.event.head_commit.author.username }} REPO: ${{ github.event.repository.full_name }} @@ -34,28 +39,39 @@ jobs: '{ cardsV2: [ { - "widgets": [ - { - "keyValue": { - "topLabel": "Repo", - "content": "${GITHUB_EVENT_REPOSITORY_FULL_NAME}" - } + cardId: "pushNotificationCard", + card: { + header: { + title: "Push to main branch", + subtitle: $commit }, - { - "keyValue": { - "topLabel": "Committed by", - "content": "${GITHUB_EVENT_HEAD_COMMIT_AUTHOR_USERNAME}" - } - }, - { - "buttons": [ - { - "textButton": { - "text": "Ref comparison", - "onClick": { - "openLink": { - "url": "${GITHUB_EVENT_COMPARE}" - } + sections: [ + { + widgets: [ + { + decoratedText: { + topLabel: "Repo", + text: $repo + } + }, + { + decoratedText: { + topLabel: "Committed by", + text: $author + } + }, + { + buttonList: { + buttons: [ + { + text: "Ref comparison", + onClick: { + openLink: { + url: $compare + } + } + } + ] } } ] @@ -64,14 +80,8 @@ jobs: } } ] - } - ] - }' - env: - GITHUB_EVENT_REPOSITORY_FULL_NAME: ${{ github.event.repository.full_name }} - GITHUB_EVENT_HEAD_COMMIT_AUTHOR_USERNAME: ${{ github.event.head_commit.author.username }} - GITHUB_EVENT_COMPARE: ${{ github.event.compare }} + }') - curl --location --request POST '${{ secrets.WEBHOOK_URL }}' \ + curl --location --request POST "$WEBHOOK_URL" \ --header 'Content-Type: application/json; charset=UTF-8' \ --data "$PAYLOAD" From 8928a19365216c4cb8379a99bca76f08b8ed867c Mon Sep 17 00:00:00 2001 From: Brianna Morales <74382627+brnnmrls@users.noreply.github.com> Date: Wed, 9 Sep 2026 14:05:49 -0700 Subject: [PATCH 4/7] Update pr_notification.yml to include more information. --- .github/workflows/pr_notification.yml | 42 ++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_notification.yml b/.github/workflows/pr_notification.yml index 3ced031b..4e4a6253 100644 --- a/.github/workflows/pr_notification.yml +++ b/.github/workflows/pr_notification.yml @@ -26,12 +26,22 @@ jobs: PR_NUMBER: ${{ github.event.pull_request.number }} TITLE: ${{ github.event.pull_request.title }} LABELS: ${{ join(github.event.pull_request.labels.*.name, ', ') }} + REPO: ${{ github.event.pull_request.head.repo.full_name }} + CREATOR: ${{ github.event.pull_request.user.login }} + STATE: ${{ github.event.pull_request.state }} + ASSIGNEES: ${{ join(github.event.pull_request.assignees.*.login, ', ') }} + REVIEWERS: ${{ join(github.event.pull_request.requested_reviewers.*.login, ', ') }} URL: ${{ github.event.pull_request.html_url }} run: | PAYLOAD=$(jq -n \ --arg pr_num "$PR_NUMBER" \ --arg title "$TITLE" \ --arg labels "$LABELS" \ + --arg repo "$REPO" \ + --arg creator "$CREATOR" \ + --arg state "$STATE" \ + --arg assignees "$ASSIGNEES" \ + --arg reviewers "$REVIEWERS" \ --arg url "$URL" \ '{ cardsV2: [ @@ -45,16 +55,46 @@ jobs: sections: [ { widgets: [ + { + decoratedText: { + topLabel: "Repo", + text: $repo + } + }, { decoratedText: { topLabel: "Title", text: $title } }, + { + decoratedText: { + topLabel: "Creator", + text: $creator + } + }, + { + decoratedText: { + topLabel: "State", + text: $state + } + }, + { + decoratedText: { + topLabel: "Assignees", + text: (if $assignees != "" then "- " + $assignees else "None" end) + } + }, + { + decoratedText: { + topLabel: "Reviewers", + text: (if $reviewers != "" then "- " + $reviewers else "None" end) + } + }, { decoratedText: { topLabel: "Labels", - text: (if $labels != "" then $labels else "None" end) + text: (if $labels != "" then "- " + $labels else "None" end) } }, { From 5886de99f1d348fdceb85809953ef90a6f57f9bd Mon Sep 17 00:00:00 2001 From: Brianna Morales <74382627+brnnmrls@users.noreply.github.com> Date: Wed, 9 Sep 2026 14:09:07 -0700 Subject: [PATCH 5/7] Update push_notification.yml to include more information From 341f87e24c2ab911ea37529f0d81e664d678a5d4 Mon Sep 17 00:00:00 2001 From: Brianna Morales <74382627+brnnmrls@users.noreply.github.com> Date: Wed, 9 Sep 2026 14:19:29 -0700 Subject: [PATCH 6/7] Update push_notification.yml with extra line --- .github/workflows/push_notification.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push_notification.yml b/.github/workflows/push_notification.yml index 73a39fec..354570f3 100644 --- a/.github/workflows/push_notification.yml +++ b/.github/workflows/push_notification.yml @@ -85,3 +85,4 @@ jobs: curl --location --request POST "$WEBHOOK_URL" \ --header 'Content-Type: application/json; charset=UTF-8' \ --data "$PAYLOAD" + From e0a80031b9b8c7dae434598cfdd4ffc01b6e8e29 Mon Sep 17 00:00:00 2001 From: Brianna Morales <74382627+brnnmrls@users.noreply.github.com> Date: Wed, 9 Sep 2026 14:19:49 -0700 Subject: [PATCH 7/7] Update pr_notification.yml with extra line --- .github/workflows/pr_notification.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_notification.yml b/.github/workflows/pr_notification.yml index 4e4a6253..6eac6dc6 100644 --- a/.github/workflows/pr_notification.yml +++ b/.github/workflows/pr_notification.yml @@ -122,3 +122,4 @@ jobs: curl --location --request POST "$WEBHOOK_URL" \ --header 'Content-Type: application/json; charset=UTF-8' \ --data "$PAYLOAD" +