Skip to content

Commit

Permalink
Update version_update_trigger.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekshindhe committed Dec 23, 2024
1 parent 90c4f9b commit 0fcf63b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/version_update_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ jobs:
else
echo "file_changed=false" >> $GITHUB_ENV
fi
- name: Post message to Slack
if: env.file_changed == 'true'
- name: Gather necessary data for the Slack notification
id: data_for_notif
run: |
#get version_line from package.json
version_line=$(grep -m 1 "\"version\":" ${GITHUB_WORKSPACE}/package.json)
Expand All @@ -36,9 +35,15 @@ jobs:
versionName=${versionName/$pattern2/}
prBody="${{ github.event.pull_request.body }}"
finalVersionName="${versionName}"
echo "$prBody"
echo "$versionName"
echo "new_version=$finalVersionName" >> GITHUB_ENV
echo "pr_changelog=$prBody" >> GITHUB_ENV
- name: Post message to Slack
if: env.file_changed == 'true'
run: |
curl -X POST -H 'Content-type: application/json; charset=UTF-8' \
-H "Authorization: Bearer ${{ secrets.CHECKOUT_SLACK_BOT_TOKEN }}" \
--data '{\"channel\":\"C1GMWKRF1\",\"text\":\"Hey, <!subteam^S6R84Q3J6>Found one version update for one of Checkout PG Core SDKs. Please find the version update details below:\\nSDK Variant: React Native Standard Checkout SDK\\nNew Version:${versionName}\\nChangelog:${prBody}\\ncc:<!subteam^S086N4NN8SU>\"}' \
https://slack.com/api/chat.postMessage
--data '{
"channel": "C02GTS30HUN",
"text": "Hey, looks like one of the Checkout PG Core SDKs is being released.\nVariant: React Native Standard Checkout SDK\nVersion: `${{ env.new_version }}`\nChangelog:\n`${{ env.pr_changelog }}`\n cc: <!subteam^S086N4NN8SU>"
}' \
https://slack.com/api/chat.postMessage

0 comments on commit 0fcf63b

Please sign in to comment.