Skip to content

Commit 9ff5fe7

Browse files
authored
Update notification syntax (google#156)
1 parent 89c87e4 commit 9ff5fe7

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

.github/workflows/pr_notification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [assigned, opened, ready_for_review, reopened, review_requested]
66

77
jobs:
8-
notify:
8+
notify-pull-request:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Pull Request Details

.github/workflows/push_notification.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
name: GSI Push Main Notification
2+
13
on:
24
push:
35
branches:
46
- main
57

68
jobs:
7-
notify:
9+
notify-push-main:
810
runs-on: ubuntu-latest
911
steps:
1012
- name: Main Branch Push
1113
run: |
12-
echo "Pushing commit to main: ${{ github.event.push.head_commit.id }}"
13-
echo "Pushed by: ${{ github.event.push.pusher.name }}"
14+
echo "Workflow initiated by event with name: ${{ github.event_name }}"
15+
echo "Pushing commit to main: ${{ github.event.head_commit.id }}"
16+
echo "Pushed by: ${{ github.event.pusher.name }}"
1417
1518
- name: Push Notification to Google Chat
1619
run: |
@@ -21,21 +24,21 @@ jobs:
2124
{
2225
"header": {
2326
"title": "Push to main branch",
24-
"subtitle": "${{ github.event.push.head_commit.message }}"
27+
"subtitle": "${{ github.event.head_commit.message }}"
2528
},
2629
"sections": [
2730
{
2831
"widgets": [
2932
{
3033
"keyValue": {
3134
"topLabel": "Repo",
32-
"content": "${{ github.event.push.repository.name }}"
35+
"content": "${{ github.event.repository.full_name }}"
3336
}
3437
},
3538
{
3639
"keyValue": {
3740
"topLabel": "Committed by",
38-
"content": "Committed by: ${{ github.event.push.head_commit.committer.username }}"
41+
"content": "${{ github.event.head_commit.author.username }}"
3942
}
4043
},
4144
{
@@ -45,7 +48,7 @@ jobs:
4548
"text": "Ref comparison",
4649
"onClick": {
4750
"openLink": {
48-
"url": "${{ github.event.push.compare }}"
51+
"url": "${{ github.event.compare }}"
4952
}
5053
}
5154
}
@@ -58,3 +61,4 @@ jobs:
5861
}
5962
]
6063
}'
64+

0 commit comments

Comments
 (0)