Skip to content

Commit

Permalink
fix(GitHub): change webhook request body field from message to text
Browse files Browse the repository at this point in the history
  • Loading branch information
hamikhambardzumyan committed Feb 21, 2024
1 parent cfa64f6 commit 2ebdb52
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/notify-reviewers.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Internal Notification Channel
name: Notify Reviewers
on:
pull_request:
types: [opened, edited]
branches: ["release/*"]
pull_request:
branches: ["release/*"]
jobs:
send_notification:
runs-on: ubuntu-latest
steps:
- name: Send Notification
env:
INTERNAL_NOTIFICATION_CHANNEL_API_ENDPOINT: ${{ secrets.INTERNAL_NOTIFICATION_CHANNEL_API_ENDPOINT }}
run: |
PR_ID=${{ github.event.pull_request.number }}
PR_URL=${{ github.event.pull_request.html_url }}
PR_AUTHOR=${{ github.event.pull_request.user.login }}
REVIEWERS=${{ github.event.pull_request.requested_reviewers.*.login }}
send_notification:
runs-on: ubuntu-latest
steps:
- name: Send Notification
env:
INTERNAL_NOTIFICATION_CHANNEL_API_ENDPOINT: ${{ secrets.INTERNAL_NOTIFICATION_CHANNEL_API_ENDPOINT }}
run: |
PR_ID=${{ github.event.pull_request.number }}
PR_URL=${{ github.event.pull_request.html_url }}
PR_AUTHOR=${{ github.event.pull_request.user.login }}
REVIEWERS="- ${{ join(github.event.pull_request.requested_reviewers.*.login, ', ') }}"
MESSAGE="New Pull Request: #$PR_ID by @$PR_AUTHOR\nLink: $PR_URL\nRequested Reviewers: $REVIEWERS"
MESSAGE="@channel\nPull Request: [#$PR_ID]($PR_URL) by @$PR_AUTHOR\nRequested Reviewers: $REVIEWERS"
curl -X POST -H "Content-Type: application/json" -d "{\"message\": \"$MESSAGE\"}" $INTERNAL_NOTIFICATION_CHANNEL_API_ENDPOINT
curl -X POST -H "Content-Type: application/json" -d "{\"text\": \"$MESSAGE\", \"username\": \"GitHub\", \"icon_url\": \"https://github.githubassets.com/favicons/favicon.png\"}" $INTERNAL_NOTIFICATION_CHANNEL_API_ENDPOINT
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: 📥 Install dependencies
run: npm install
run: npm ci
- name: 🔧 Build
run: npm run build
- name: 📦 Publish package on NPM
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: 📥 Install dependencies
run: npm install
- name: 🔧 Pure build
run: npm ci
- name: 🔧 Pure build
run: npm run build -- --pure
- name: 🧪 Run tests
run: npm run test
Expand Down

0 comments on commit 2ebdb52

Please sign in to comment.