Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b0ab4d8
chore: updates release yml (#171)
cb-haripriyan Dec 12, 2023
0059f15
fix: multiple callback issue (#172)
cb-pravinrajmohan Dec 12, 2023
96463bd
chore: release 2.4.5 [skip ci]
cb-anurags Dec 12, 2023
4063283
Merge pull request #173 from chargebee/docs-v2.4.5
cb-haripriyan Dec 12, 2023
ee552de
chore: remove duplicate declarations
cb-pravinrajmohan Dec 28, 2023
f06cdc3
chore: update pkg version
cb-pravinrajmohan Jan 5, 2024
3bc705c
Revert "chore: update pkg version"
cb-pravinrajmohan Jan 5, 2024
1af8a36
Merge pull request #175 from cb-pravinrajmohan/chore/remove-duplicate…
cb-pravinrajmohan Jan 5, 2024
5ff22a5
chore: release 2.4.6 [skip ci]
cb-pravinrajmohan Jan 5, 2024
daeb174
Merge pull request #176 from chargebee/docs-v2.4.6
cb-haripriyan Jan 5, 2024
411b066
feat: updating billing client from 5 to 6
cb-palanim Jul 19, 2024
19d6f4c
feat: discard package changes
cb-palanim Jul 19, 2024
66e64b9
Merge pull request #181 from chargebee/bl6-upgrade
cb-haripriyan Jul 19, 2024
762c988
feat: update secret name
cb-palanim Jul 20, 2024
1bb1a4a
Merge pull request #183 from chargebee/bl6-upgrade
cb-haripriyan Jul 20, 2024
7882016
chore: release 2.5.0 [skip ci]
cb-haripriyan Jul 20, 2024
39d7531
Merge pull request #184 from chargebee/docs-v2.5.0
cb-haripriyan Jul 20, 2024
5776237
Secret scan workflow added for all the prs
cb-rohitsharma Mar 27, 2025
7aa40fd
Merge pull request #187 from chargebee/chore/workflow_secret_scan
cb-haripriyan Apr 16, 2025
0a6c4b6
workflow updated
cb-rohitsharma Apr 21, 2025
0d4cbb3
Merge pull request #188 from chargebee/chore/workflow_secret_scan
cb-shreygupta Apr 22, 2025
f4050da
legacy message added
cb-shreygupta Jun 23, 2025
8877f22
Merge pull request #191 from chargebee/chore/legacy_message
cb-haripriyan Jul 1, 2025
1d55ee2
Upgraded billing lib & cb-android version
cb-rohitsharma Jul 17, 2025
0830294
version upgraded
cb-rohitsharma Jul 17, 2025
6537d99
Merge pull request #193 from chargebee/chore/upgrade-billing-lib-v7
cb-haripriyan Jul 22, 2025
4491fd1
updated cache action version in release workflow
cb-rohitsharma Jul 22, 2025
dddec0b
Merge pull request #195 from chargebee/chore/update-cache-version
cb-haripriyan Jul 22, 2025
2bb659f
updated npm token
cb-rohitsharma Jul 22, 2025
92d3cc1
Merge pull request #197 from chargebee/chore/update_token
cb-haripriyan Jul 22, 2025
990594f
chore: release 2.5.1 [skip ci]
cb-haripriyan Jul 22, 2025
a8e73bd
Merge pull request #198 from chargebee/docs-v2.5.1
cb-haripriyan Jul 22, 2025
ad40267
updated kotlin version to 1.9.23
cb-rohitsharma Jul 29, 2025
b6bc868
pulled master
cb-rohitsharma Jul 29, 2025
cfb3541
Merge pull request #201 from chargebee/chore/update-kotlin-version
cb-haripriyan Jul 30, 2025
ba89e71
PR standardization
cb-anomitromunshi Mar 13, 2026
18191d0
PR standardization
cb-anomitromunshi Mar 13, 2026
05c5d56
PR standardization
cb-anomitromunshi Mar 13, 2026
a4a401f
PR standardization
cb-anomitromunshi Mar 13, 2026
388d8a7
PR standardization
cb-anomitromunshi Mar 13, 2026
eeb7a74
Update PR size check to target master branch
cb-anomitromunshi Mar 13, 2026
8a23189
Merge pull request #212 from chargebee/feat/EE-651
cb-jeevitha Jun 17, 2026
39097bb
chore: use frozen lockfile for CI dependency installs
cb-jit-bhuin Aug 5, 2026
1a9177e
ci: bump actions/cache to v4 in build workflow
cb-jit-bhuin Aug 5, 2026
32ff61e
Merge branch 'next' into chore/deterministic-ci-installs
cb-jit-bhuin Aug 5, 2026
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
29 changes: 29 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## CHANGELOG
REPLACE_ME_WITH_CHANGELOG

## SUMMARY
REPLACE_ME_WITH_SUMMARY_OF_THE_CHANGES

## FUNCTIONAL AUTOMATION CHANGES PR
- [ ] Yes
- If Yes, PR :
- [ ] No
- If No, Reason:

## AUTOMATION TEST REPORT URL
REPLACE_ME_WITH_TEST_REPORT_URL

## AREAS OF IMPACT
REPLACE_ME_WITH_AREAS_OF_IMPACT_OR_NA

## TYPE OF CHANGE
- [ ] 🐞 Bugfix
- [ ] 🌟 Feature
- [ ] ✨ Enhancement
- [ ] 🧪 Unit Test Cases
- [ ] 📔 Documentation
- [ ] ⚙️ Chore - Build Related / Configuration / Others


## DOCUMENTATION
REPLACE_ME_WITH_DOCUMENTATION_LINK_OR_NA
31 changes: 31 additions & 0 deletions .github/scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Scripts

## Generate changelog

Lists PRs merged into a branch (excludes "Parent branch sync" and bot-authored PRs).

**Prerequisites:** `jq`, and GitHub credentials as env vars.

### Set credentials (once per terminal)

```bash
export GH_USERNAME=your-github-username
export GH_PAT=your-github-personal-access-token
```

### Commands

From repo root:

| What you want | Command |
|---------------|---------|
| PRs merged into **current branch** (last 30 days) | `./.github/scripts/generate-changelog.sh` |
| PRs merged into **master** (last 30 days) | `./.github/scripts/generate-changelog.sh master` |
| PRs merged into **master** since a date | `./.github/scripts/generate-changelog.sh master "merged:>=2025-01-01"` |

### Arguments

1. **Branch** (optional) — default: current branch
2. **Date filter** (optional) — default: last 30 days (e.g. `merged:>=2025-01-01`)

Output includes a GitHub search URL to verify results.
84 changes: 84 additions & 0 deletions .github/scripts/generate-changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash

set -e

# Check required environment variables
if [[ -z "$GH_USERNAME" ]]; then
echo "❌ Error: Environment variable GH_USERNAME not found"
exit 1
fi

if [[ -z "$GH_PAT" ]]; then
echo "❌ Error: Environment variable GH_PAT not found"
exit 1
fi

# Optional: Branch name (defaults to current branch if not provided)
SOURCE_BRANCH="${1:-$(git branch --show-current)}"
# Optional: Date filter (defaults to last 30 days if not provided)
DATE_FILTER="${2:-merged:>=$(date -u -v-30d +%Y-%m-%d 2>/dev/null || date -u -d '30 days ago' +%Y-%m-%d)}"

# Repo is set per-repo when this file is pushed (placeholder replaced by upload script)
REPO="chargebee/chargebee-react-native"

echo "🔍 Searching for PRs merged into $SOURCE_BRANCH..."

# GitHub API call with error handling
HTTP_STATUS=$(curl -s -w "%{http_code}" -G -u "$GH_USERNAME:$GH_PAT" \
"https://api.github.com/search/issues" \
--data-urlencode "q=NOT \"Parent branch sync\" in:title is:pr repo:$REPO is:merged base:$SOURCE_BRANCH merged:$DATE_FILTER -author:app/distributed-gitflow-app" \
-o /tmp/curl_output.json \
2>/tmp/curl_error.log)

CURL_EXIT_CODE=$?

echo "🌐 API call status: $HTTP_STATUS"

if [ $CURL_EXIT_CODE -ne 0 ]; then
echo "❌ Error: curl request failed with exit code $CURL_EXIT_CODE"
echo "Error details: $(cat /tmp/curl_error.log)"
exit 1
fi

if [ "$HTTP_STATUS" -ne 200 ]; then
echo "❌ Error: API returned HTTP status $HTTP_STATUS"
echo "Response: $(cat /tmp/curl_output.json)"
exit 1
fi

PR_LIST_RESPONSE=$(cat /tmp/curl_output.json)

# Clean invalid control characters from JSON response
if ! echo "$PR_LIST_RESPONSE" | jq . >/dev/null 2>&1; then
echo "⚠️ Invalid JSON detected — cleaning control characters..."
PR_LIST_RESPONSE=$(echo "$PR_LIST_RESPONSE" | tr -d '\000-\037')

if ! echo "$PR_LIST_RESPONSE" | jq . >/dev/null 2>&1; then
echo "$PR_LIST_RESPONSE" > /tmp/invalid_json_debug.json
echo "❌ Error: JSON is still invalid after cleaning control characters"
echo "💡 Use 'cat /tmp/invalid_json_debug.json' to inspect the JSON"
exit 1
fi
fi

PR_MERGED_COUNT=$(echo "$PR_LIST_RESPONSE" | jq '.total_count')

# Color codes
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NOCOLOR='\033[0m'

echo "=============================================================================="
echo -e "Found ${GREEN}$PR_MERGED_COUNT${NOCOLOR} PR(s) merged into $SOURCE_BRANCH (filter: $DATE_FILTER)"
echo "=============================================================================="
echo -e "## ${GREEN}CHANGELOG${NOCOLOR}"
echo "$PR_LIST_RESPONSE" | jq -r '.items[] | (.title) + " (" + (.user.login) + ") [#" + (.number | tostring) + "]"' | sort
printf "\n"
echo "=============================================================================="
echo -e "${GREEN}GitHub Search URL (to verify, if required)${NOCOLOR}"
BRANCH_ENCODED=$(echo "$SOURCE_BRANCH" | sed 's/ /%20/g')
echo "https://github.com/$REPO/pulls?q=NOT+%22Parent+branch+sync%22+in%3Atitle+is%3Apr+is%3Amerged+base%3A$BRANCH_ENCODED+merged%3A$DATE_FILTER+-author%3Aapp%2Fdistributed-gitflow-app"
echo "=============================================================================="

# Clean up temporary files
rm -f /tmp/curl_output.json /tmp/curl_error.log
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
run: corepack enable
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: yarn install
run: yarn install --frozen-lockfile
- name: Linter
run: yarn run eslint
- name: Yarn Tests
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Common PR Lint

on:
pull_request:
branches: [master, main,staging, dev,develop]
types: [ready_for_review, reopened, review_requested, review_request_removed, opened, edited]

jobs:
pr-lint:
name: Common PR Lint Checks
if: github.base_ref == 'main' || github.base_ref == 'master'
uses: chargebee/cb-cicd-pipelines/.github/workflows/pr-lint.yml@main
secrets: inherit
81 changes: 81 additions & 0 deletions .github/workflows/pr-size-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: PR Size Check
on:
pull_request:
types: [ reopened, opened, synchronize, edited, labeled, unlabeled ]
branches:
- master


jobs:
pre-approval-comment:
name: Announce pending bypass approval
if: ${{ github.event.pull_request.user.login != 'distributed-gitflow-app[bot]' &&
!startsWith(github.head_ref, 'revert-') &&
!startsWith(github.head_ref, 'parent-branch-sync/') &&
contains(github.event.pull_request.labels.*.name, 'pr-size-exception') }}
runs-on: graviton-small-runner
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const issue_number = context.payload.pull_request.number;

const marker = '<!-- pr-size-bypass-pending -->';
const pending = `${marker}
🛑 The \`pr-size-exception\` label is present. This workflow is **waiting for approvals** from the **[cb-Billing-CAB-reviewers](https://github.com/orgs/chargebee/teams/cb-billing-cab-approvers)**.`;

// create a new comment when the workflow runs
await github.rest.issues.createComment({ owner, repo, issue_number, body: pending });
pr-size-check:
name: Check PR size
if: ${{ (github.base_ref == 'master') && github.event.pull_request.user.login != 'distributed-gitflow-app[bot]' && !startsWith(github.head_ref, 'revert-') && !startsWith(github.head_ref, 'parent-branch-sync/') }}
runs-on: graviton-small-runner
permissions:
contents: read
pull-requests: write
id-token: write
env:
BYPASS_LABEL: pr-size-exception
environment: ${{ contains(github.event.pull_request.labels.*.name, 'pr-size-exception') && 'cb-billing-reviewers' || '' }}
steps:
- uses: chargebee/cb-cicd-pipelines/.github/actions/pr-size-check@v4.20.3
if: ${{ !contains(github.event.pull_request.labels.*.name, env.BYPASS_LABEL) }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
errorSize: 250
warningSize: 200
excludePaths: |
.github/**
.cursor/**


- name: Ensure required check passes when bypassed
if: ${{ contains(github.event.pull_request.labels.*.name, env.BYPASS_LABEL) }}
run: echo "Bypass active — marking job successful."

- name: Configure OIDC authentication
if: ${{ contains(github.event.pull_request.labels.*.name, env.BYPASS_LABEL) }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::127322177288:role/OIDC_S3
role-session-name: GithubActionsSession
role-duration-seconds: 900
aws-region: us-east-1

- name: Record bypass approval to S3
if: ${{ contains(github.event.pull_request.labels.*.name, env.BYPASS_LABEL) }}
run: |
REPO="${{ github.repository }}"
PR_LINK="https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
WF_ID="${{ github.run_id }}"
S3_KEY="${REPO}/datas/${WF_ID}.json"
printf '{"repo":"%s","date":"%s","pr_link":"%s","wf_id":"%s"}\n' "$REPO" "$DATE" "$PR_LINK" "$WF_ID" | \
aws s3 cp - "s3://prsizebypassdata/${S3_KEY}" --content-type application/json
echo "Recorded to s3://prsizebypassdata/${S3_KEY}"
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
branches:
- master
- next
paths-ignore:
- 'CHANGELOG.md'
- 'package-lock.json'
- 'package.json'
jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -26,14 +30,14 @@ jobs:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: yarn install
run: yarn install --frozen-lockfile
- name: Initialize NPM config
run: |
npm config set registry=https://registry.npmjs.com/
Expand All @@ -51,7 +55,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release package
if: github.ref == 'refs/heads/master'
run: npm run release -- --ci -VV
run: npm run release -- --ci -VV
env:
NPM_TOKEN: ${{ secrets.RN_SDK_NPM_WRITE_TOKEN_2 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/secret.scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CB Secret PR Scan

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
scan:
name: Secret PR Scan
runs-on: ubuntu-latest
steps:
- name: Get the file name changed in the PR
id: pr_files
run: |
changed_files=$(curl -s -H "Authorization: token ${{
secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files | jq -r '.[].filename')
echo "Changed files: $changed_files"

echo "CHANGED_FILES<<EOF"$'\n'"$changed_files"$'\n'EOF >> $GITHUB_OUTPUT

- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: gitleaks/gitleaks-action@v2
env:
GITLEAKS_ENABLE_UPLOAD_ARTIFACT: false
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITLEAKS_LICENSE: '${{ secrets.GITLEAKS_LICENSE }}'
GITLEAKS_ENABLE_SUMMARY: false
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@
* handles subscription and plan id as mandatory in purchase product api ([aa0bf7c](https://github.com/chargebee/chargebee-react-native/commit/aa0bf7cecec105b7ea8e3350e70a5fa88617c35d))

### BREAKING CHANGES
* Adds In-App Purchase support
* Adds In-App Purchase support
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
> [!WARNING]
> **Chargebee React Native SDK** is part of Chargebee's legacy Mobile Subscription Solution and will not include the latest enhancements. We recommend using Chargebee's new [Omnichannel Subscriptions](https://www.chargebee.com/docs/billing/2.0/mobile-subscriptions/omnichannel-subscription-overview) solution for improved reliability and unified mobile subscriptions experience.
If you are a new customer, or considering to migrate new solution, please reach out to support@chargebee.com or contact your Technical Success Manager (TSM) for guidance.

![Latest Release](https://github.com/chargebee/chargebee-react-native/actions/workflows/release.yml/badge.svg?branch=master)

> [!NOTE]
Expand Down
Loading