Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static Checkout SDK version to ensure avoidance of maven repository server downtimes #490

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/version_update_trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Version trigger workflow

on:
pull_request:

jobs:
build:
runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Fetch the pull request diff
run: git fetch origin ${{ github.event.pull_request.base.sha }} ${{ github.sha }}

- name: Check if a particular file has changed
id: check_file
run: |
# Check if 'package.json' has changed in the PR
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q 'package.json'; then
echo "file_changed=true" >> $GITHUB_ENV
else
echo "file_changed=false" >> $GITHUB_ENV
fi

- name: Post message to Slack
if: env.file_changed == 'true'
run: |
#get version_line from package.json
version_line=$(grep -m 1 "\"version\":" ${GITHUB_WORKSPACE}/package.json)
#versionName substring generation
pattern1="\"version\": \""
pattern2="\","
versionName=${version_line/$pattern1/}
versionName=${versionName/$pattern2/}
prBody="${{ github.event.pull_request.body }}"
curl -X POST -H 'Content-type: application/json; charset=UTF-8' \
-H "Authorization: Bearer ${{ secrets.CHECKOUT_SLACK_BOT_TOKEN }}" \
--data '{
"channel": "C02GTS30HUN",
"text": "Version update found for Checkout PG Core SDK. 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
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ android {

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'com.razorpay:checkout:1.6.+'
implementation 'com.razorpay:checkout:1.6.41'
}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-razorpay",
"version": "2.3.0",
"version": "2.3.1",
"description": "React Native wrapper for Razorpay",
"main": "RazorpayCheckout.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1