cobrowse-sdk-react-native 3.7.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.github/actions/install-npm-deps/action.yml +26 -0
  2. package/.github/actions/install-packaged-sdk/action.yml +22 -0
  3. package/.github/actions/install-pods/action.yml +20 -0
  4. package/.github/workflows/build-android.yml +37 -0
  5. package/.github/workflows/build-ios.yml +51 -0
  6. package/.github/workflows/build.yml +67 -0
  7. package/.github/workflows/e2e-android.yml +95 -0
  8. package/.github/workflows/e2e-ios.yml +58 -0
  9. package/.github/workflows/release.yml +2 -2
  10. package/.github/workflows/test.yml +40 -0
  11. package/.github/workflows/update-packages.yml +34 -28
  12. package/.vscode/extensions.json +6 -0
  13. package/.vscode/launch.json +11 -0
  14. package/.vscode/settings.json +1 -1
  15. package/CHANGELOG.md +359 -0
  16. package/android/build.gradle +1 -1
  17. package/cobrowse-sdk-react-native.podspec +1 -1
  18. package/js/Session.ts +8 -3
  19. package/lib/commonjs/CBIOBroadcastPickerView.js +4 -1
  20. package/lib/commonjs/CBIOBroadcastPickerView.js.map +1 -1
  21. package/lib/commonjs/CobrowseAccessibilityService.js.map +1 -1
  22. package/lib/commonjs/CobrowseIO.js.map +1 -1
  23. package/lib/commonjs/CobrowseView.js +33 -22
  24. package/lib/commonjs/CobrowseView.js.map +1 -1
  25. package/lib/commonjs/Redacted.js +6 -4
  26. package/lib/commonjs/Redacted.js.map +1 -1
  27. package/lib/commonjs/Session.js +10 -5
  28. package/lib/commonjs/Session.js.map +1 -1
  29. package/lib/commonjs/SessionControl.js +1 -1
  30. package/lib/commonjs/SessionControl.js.map +1 -1
  31. package/lib/commonjs/Unredacted.js +6 -7
  32. package/lib/commonjs/Unredacted.js.map +1 -1
  33. package/lib/commonjs/index.js.map +1 -1
  34. package/lib/commonjs/package.json +1 -0
  35. package/lib/commonjs/useSession.js.map +1 -1
  36. package/lib/module/CBIOBroadcastPickerView.js +6 -1
  37. package/lib/module/CBIOBroadcastPickerView.js.map +1 -1
  38. package/lib/module/CobrowseAccessibilityService.js +2 -0
  39. package/lib/module/CobrowseAccessibilityService.js.map +1 -1
  40. package/lib/module/CobrowseIO.js +2 -0
  41. package/lib/module/CobrowseIO.js.map +1 -1
  42. package/lib/module/CobrowseView.js +35 -22
  43. package/lib/module/CobrowseView.js.map +1 -1
  44. package/lib/module/Redacted.js +8 -4
  45. package/lib/module/Redacted.js.map +1 -1
  46. package/lib/module/Session.js +12 -5
  47. package/lib/module/Session.js.map +1 -1
  48. package/lib/module/SessionControl.js +3 -1
  49. package/lib/module/SessionControl.js.map +1 -1
  50. package/lib/module/Unredacted.js +8 -7
  51. package/lib/module/Unredacted.js.map +1 -1
  52. package/lib/module/index.js +2 -0
  53. package/lib/module/index.js.map +1 -1
  54. package/lib/module/useSession.js +2 -0
  55. package/lib/module/useSession.js.map +1 -1
  56. package/lib/typescript/Session.d.ts.map +1 -1
  57. package/package.json +15 -3
  58. package/tsconfig.build.json +4 -1
  59. package/tsconfig.json +4 -2
  60. package/.github/workflows/lint.yaml +0 -20
@@ -0,0 +1,26 @@
1
+ name: Install npm dependencies
2
+ description: >-
3
+ Install Node.js (with npm caching) and run `npm ci` for both the SDK (repo root —
4
+ needed by the symlinked SDK and `npm pack`) and the Example app, so the Example is
5
+ ready to build. Assumes the repo is already checked out.
6
+
7
+ runs:
8
+ using: composite
9
+ steps:
10
+ - name: Install Node.js
11
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
12
+ with:
13
+ node-version: '24'
14
+ cache: 'npm'
15
+ cache-dependency-path: |
16
+ package-lock.json
17
+ Example/package-lock.json
18
+
19
+ - name: Install SDK dependencies
20
+ shell: bash
21
+ run: npm ci
22
+
23
+ - name: Install Example dependencies
24
+ shell: bash
25
+ run: npm ci
26
+ working-directory: Example
@@ -0,0 +1,22 @@
1
+ name: Install the packaged SDK into the Example app
2
+ description: >-
3
+ Pack the SDK (`npm pack` → runs prepack = `bob build`, exactly what publish does)
4
+ and install the tarball over the Example app's `file:../` symlink, so the app
5
+ bundles/links against what actually ships rather than the working tree. `npm install`
6
+ is used rather than manually extracting the tarball so npm resolves the SDK's runtime
7
+ deps (e.g. lodash). Assumes Node and the Example app's deps are already installed.
8
+
9
+ runs:
10
+ using: composite
11
+ steps:
12
+ - name: Install the packaged SDK into the Example app
13
+ shell: bash
14
+ run: |
15
+ npm pack --pack-destination "$RUNNER_TEMP"
16
+ cd Example
17
+ npm install "$RUNNER_TEMP"/cobrowse-sdk-react-native-*.tgz --no-save
18
+ # The install must have replaced the file:../ symlink with the real package,
19
+ # otherwise we'd silently be testing the working tree again.
20
+ test -d node_modules/cobrowse-sdk-react-native && test ! -L node_modules/cobrowse-sdk-react-native \
21
+ || { echo "::error::packaged SDK install did not take (dependency is still a symlink)"; exit 1; }
22
+ echo "Installed packaged SDK $(node -p "require('./node_modules/cobrowse-sdk-react-native/package.json').version")"
@@ -0,0 +1,20 @@
1
+ name: Install CocoaPods dependencies
2
+ description: >-
3
+ Run `pod install` for the Example iOS app, retrying to survive the transient 503s that
4
+ hit Hermes' source download. Assumes the Example's node deps (and, for the e2e, the
5
+ packaged SDK) are already installed, since `pod install` resolves native modules from
6
+ node_modules.
7
+
8
+ runs:
9
+ using: composite
10
+ steps:
11
+ - name: Install Pods
12
+ shell: bash
13
+ working-directory: Example/ios
14
+ run: |
15
+ for attempt in 1 2 3; do
16
+ pod install && exit 0
17
+ echo "pod install failed (attempt $attempt) — retrying in 15s…"
18
+ sleep 15
19
+ done
20
+ exit 1
@@ -0,0 +1,37 @@
1
+ name: Build Android
2
+
3
+ # Compiles and validates the SDK's native Android module by building the Example app.
4
+
5
+ on:
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ # A newer push to the same PR cancels the in-flight run.
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ build-android:
18
+ name: Build Example app (Android)
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 25
21
+ steps:
22
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
23
+
24
+ - name: Install npm dependencies
25
+ uses: ./.github/actions/install-npm-deps
26
+
27
+ # AGP 8.2.2 / Gradle 8.2.1 require JDK 17 (they reject 21). Pin explicitly.
28
+ - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
29
+ name: Install JDK 17
30
+ with:
31
+ distribution: 'temurin'
32
+ java-version: '17'
33
+ cache: 'gradle'
34
+
35
+ - name: Build debug APK
36
+ run: ./gradlew :app:assembleDebug
37
+ working-directory: Example/android
@@ -0,0 +1,51 @@
1
+ name: Build iOS
2
+
3
+ # Compiles and validates the SDK's native iOS module by building the Example app.
4
+
5
+ on:
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ # A newer push to the same PR cancels the in-flight run.
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ build-ios:
18
+ name: Build Example app (iOS)
19
+ runs-on: macos-14
20
+ timeout-minutes: 45
21
+ steps:
22
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
23
+
24
+ - name: Install npm dependencies
25
+ uses: ./.github/actions/install-npm-deps
26
+
27
+ - name: Install Pods
28
+ uses: ./.github/actions/install-pods
29
+
30
+ # Simulator build so no signing needed. Also compiles the Full-Device-Screen-Sharing extension.
31
+ - name: Build Example app
32
+ working-directory: Example/ios
33
+ run: |
34
+ xcodebuild \
35
+ -workspace Example.xcworkspace \
36
+ -scheme Example \
37
+ -configuration Debug \
38
+ -destination 'generic/platform=iOS Simulator' \
39
+ -resultBundlePath build/Example.xcresult \
40
+ CODE_SIGNING_ALLOWED=NO \
41
+ build
42
+
43
+ # xcodebuild output is huge/truncated in the UI; the .xcresult has the structured errors.
44
+ - name: Upload xcodebuild result bundle (on failure)
45
+ if: failure()
46
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
47
+ with:
48
+ name: ios-xcresult
49
+ path: Example/ios/build/Example.xcresult
50
+ retention-days: 7
51
+ if-no-files-found: ignore
@@ -0,0 +1,67 @@
1
+ name: Build
2
+
3
+ # Builds and validates the publishable npm package.
4
+
5
+ on:
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ # A newer push to the same PR cancels the in-flight run.
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ build-package:
18
+ name: Build & validate npm package
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 10
21
+ steps:
22
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
23
+
24
+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
25
+ name: Install Node.js
26
+ with:
27
+ node-version: '24'
28
+ cache: 'npm'
29
+
30
+ - name: Install dependencies
31
+ run: npm ci
32
+
33
+ - name: Build package (react-native-builder-bob)
34
+ run: npm run build
35
+
36
+ # `npm pack` runs the `prepack` script (bob build), so a dry-run exercises
37
+ # the exact build path `npm publish` takes — a broken publish fails here.
38
+ - name: Validate publish/pack path
39
+ run: npm pack --dry-run
40
+
41
+ # --- Advisory checks (non-blocking for now) ---
42
+ # These surface real, pre-existing packaging issues (main/module both point
43
+ # at the ESM build; no `type` field; internal files shipped). They are
44
+ # `continue-on-error` until the packaging fixes land, then flip to required
45
+ # by removing `continue-on-error` (and add `--strict` to publint).
46
+
47
+ - name: Validate package exports (publint) [advisory]
48
+ continue-on-error: true
49
+ run: npx --yes publint@0.3.22
50
+
51
+ - name: Validate type resolution (are-the-types-wrong) [advisory]
52
+ continue-on-error: true
53
+ run: npx --yes @arethetypeswrong/cli@0.18.5 --pack .
54
+
55
+ # Repo sanity: no build/codegen step above should modify or create tracked
56
+ # files. lib/ is gitignored, so this is a no-op today — it's a tripwire for
57
+ # when generated artefacts or a codegen step (e.g. a bob upgrade) later
58
+ # become part of the repo. `git status --porcelain` also catches new
59
+ # untracked files, which `git diff --exit-code` would miss.
60
+ - name: Verify working tree is clean
61
+ run: |
62
+ if [ -n "$(git status --porcelain)" ]; then
63
+ echo "::error::Build steps modified tracked files — commit the changes or fix the build."
64
+ git status --porcelain
65
+ git diff
66
+ exit 1
67
+ fi
@@ -0,0 +1,95 @@
1
+ name: E2E Android
2
+
3
+ # Validates the native Android Example app builds, runs, and can call the Cobrowse SDK.
4
+
5
+ on:
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ # A newer push to the same PR cancels the in-flight run.
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ e2e-android:
18
+ name: E2E Example app (Android)
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 45
21
+ # Build the Example against the *packaged* SDK (installed below), not the
22
+ # working-tree symlink — so this validates what actually ships. Read by
23
+ # Example/metro.config.js to pick the packaged-vs-symlink resolver.
24
+ env:
25
+ E2E_PACKAGED: '1'
26
+ steps:
27
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
28
+
29
+ - name: Install npm dependencies
30
+ uses: ./.github/actions/install-npm-deps
31
+
32
+ # AGP 8.2.2 / Gradle 8.2.1 require JDK 17.
33
+ - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
34
+ name: Install JDK 17
35
+ with:
36
+ distribution: 'temurin'
37
+ java-version: '17'
38
+ cache: 'gradle'
39
+
40
+ - name: Install the packaged SDK into the Example app
41
+ uses: ./.github/actions/install-packaged-sdk
42
+
43
+ # Release embeds the JS bundle and is debug-keystore signed, so both APKs install on the emulator.
44
+ - name: Build release + test APKs
45
+ run: ./gradlew :app:assembleRelease :app:assembleReleaseAndroidTest
46
+ working-directory: Example/android
47
+
48
+ # Reclaim space from large preinstalled toolchains we don't use. The emulator's
49
+ # userdata partition is ~7GB once the build outputs are on disk.
50
+ - name: Free up disk space
51
+ run: |
52
+ df -h /
53
+ sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup \
54
+ /usr/share/swift /opt/hostedtoolcache/CodeQL
55
+ df -h /
56
+
57
+ # Emulators need hardware acceleration (KVM) to boot in reasonable time.
58
+ - name: Enable KVM
59
+ run: |
60
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
61
+ sudo udevadm control --reload-rules
62
+ sudo udevadm trigger --name-match=kvm
63
+
64
+ - name: Boot emulator and run E2E tests
65
+ uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
66
+ env:
67
+ # Wait longer for the emulator to shut down cleanly before the action force-kills
68
+ # it (default 20s) — avoids spurious teardown errors on slow/loaded runners.
69
+ ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 180
70
+ with:
71
+ api-level: 34
72
+ target: google_apis
73
+ arch: x86_64
74
+ force-avd-creation: false
75
+ working-directory: Example/android
76
+ emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
77
+ disable-animations: true
78
+ # Capture full logcat to a file (uploaded on failure) for red-run diagnostics,
79
+ # then install the app + test APKs, run E2ETests, and report pass/fail.
80
+ script: |
81
+ adb logcat -c
82
+ adb logcat > emulator.log &
83
+ ./gradlew :app:connectedReleaseAndroidTest
84
+
85
+ # Test reports + full logcat for debugging red runs.
86
+ - name: Upload instrumented-test report (on failure)
87
+ if: failure()
88
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
89
+ with:
90
+ name: android-e2e-report
91
+ path: |
92
+ Example/android/app/build/reports/androidTests/connected
93
+ Example/android/emulator.log
94
+ retention-days: 7
95
+ if-no-files-found: ignore
@@ -0,0 +1,58 @@
1
+ name: E2E iOS
2
+
3
+ # Validates the native iOS Example app builds, runs, and can call the Cobrowse SDK.
4
+
5
+ on:
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ # A newer push to the same PR cancels the in-flight run.
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ e2e-ios:
18
+ name: E2E Example app (iOS)
19
+ runs-on: macos-14
20
+ timeout-minutes: 60
21
+ # Build the Example against the *packaged* SDK (installed below), not the
22
+ # working-tree symlink — so this validates what actually ships. Read by
23
+ # Example/metro.config.js (JS bundle) and, via node_modules, by `pod install`.
24
+ env:
25
+ E2E_PACKAGED: '1'
26
+ steps:
27
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
28
+
29
+ - name: Install npm dependencies
30
+ uses: ./.github/actions/install-npm-deps
31
+
32
+ # pod install (next) resolves the packaged podspec + ios/ from node_modules.
33
+ - name: Install the packaged SDK into the Example app
34
+ uses: ./.github/actions/install-packaged-sdk
35
+
36
+ - name: Install Pods
37
+ uses: ./.github/actions/install-pods
38
+
39
+ # Release config embeds the JS bundle (no Metro); simulator build needs no signing.
40
+ - name: Run iOS E2E test
41
+ working-directory: Example/ios
42
+ run: |
43
+ xcodebuild test \
44
+ -workspace Example.xcworkspace \
45
+ -scheme Example \
46
+ -configuration Release \
47
+ -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' \
48
+ -resultBundlePath build/ExampleE2E.xcresult \
49
+ CODE_SIGNING_ALLOWED=NO
50
+
51
+ - name: Upload xcresult (on failure)
52
+ if: failure()
53
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
54
+ with:
55
+ name: ios-e2e-xcresult
56
+ path: Example/ios/build/ExampleE2E.xcresult
57
+ retention-days: 7
58
+ if-no-files-found: ignore
@@ -14,9 +14,9 @@ jobs:
14
14
  id-token: write
15
15
 
16
16
  steps:
17
- - uses: actions/checkout@v3
17
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
18
18
 
19
- - uses: actions/setup-node@v4
19
+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
20
20
  with:
21
21
  node-version: '24'
22
22
  registry-url: 'https://registry.npmjs.org'
@@ -0,0 +1,40 @@
1
+ name: Test
2
+
3
+ # Correctness checks for the JS layer: lint, type-check, and unit tests.
4
+
5
+ on:
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ # A newer push to the same PR cancels the in-flight run.
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ test:
18
+ name: Lint, type-check & unit tests
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 10
21
+ steps:
22
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
23
+
24
+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
25
+ name: Install Node.js
26
+ with:
27
+ node-version: '24'
28
+ cache: 'npm'
29
+
30
+ - name: Install dependencies
31
+ run: npm ci
32
+
33
+ - name: Lint (ts-standard)
34
+ run: npm run lint
35
+
36
+ - name: Type-check (tsc --noEmit)
37
+ run: npm run typecheck
38
+
39
+ - name: Unit tests (jest)
40
+ run: npm test
@@ -14,19 +14,22 @@ on:
14
14
  type: string
15
15
  required: false
16
16
 
17
- permissions:
18
- contents: write
19
- pull-requests: write
20
-
21
17
  jobs:
22
18
  android:
23
19
  runs-on: ubuntu-latest
24
20
  if: ${{ github.event.inputs.platform == 'Android' }}
25
21
  steps:
22
+ - uses: cobrowseio/actions/.github/actions/git-auth@master
23
+ id: app-token
24
+ with:
25
+ client-id: ${{ vars.COBROWSE_BOT_CLIENT_ID }}
26
+ private-key: ${{ secrets.COBROWSE_BOT_KEY }}
27
+ permission-contents: write
28
+
26
29
  - name: Checkout repository
27
- uses: actions/checkout@v3
30
+ uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
28
31
  with:
29
- token: ${{ secrets.GH_REPO_TOKEN }}
32
+ token: ${{ steps.app-token.outputs.token }}
30
33
 
31
34
  - name: Get the new Android version from the input parameter
32
35
  if: "${{ github.event.inputs.cobrowse_sdk_version != '' }}"
@@ -41,21 +44,19 @@ jobs:
41
44
  - name: Update build.gradle file
42
45
  run: sed -i "s/\(io\.cobrowse\:cobrowse-sdk-android\:\).*/\\1${COBROWSE_VERSION}'/" android/build.gradle
43
46
 
44
- # If the SDK was updated, commit the changes and open a new pull request
45
- - name: Create a new pull request
47
+ # If the SDK was updated, commit the changes back to the repo
48
+ - name: Commit the changes
46
49
  env:
47
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48
50
  FILES_TO_COMMIT: android/build.gradle
49
- NEW_BRANCH_NAME: feature/update_packages_${{ github.run_id }}
50
51
  run: |
51
52
  if [[ `git status --porcelain $FILES_TO_COMMIT` ]]; then
52
- git config --local user.name "Cobrowse.io Bot"
53
- git config --local user.email "github@cobrowse.io"
54
- git checkout -b $NEW_BRANCH_NAME
55
53
  git add $FILES_TO_COMMIT
56
- git commit -m "feat: update Cobrowse.io SDK"
57
- git push origin $NEW_BRANCH_NAME
58
- gh pr create -B master -H $NEW_BRANCH_NAME --title 'Update native Android SDK' --body ''
54
+ git commit -m "feat: update Cobrowse Android SDK to ${COBROWSE_VERSION}"
55
+ # Pull the changes that might have been commited during this run
56
+ git config pull.rebase true
57
+ git config rebase.autoStash true
58
+ git pull origin
59
+ git push
59
60
  else
60
61
  echo "No changes to commit"
61
62
  fi
@@ -64,10 +65,17 @@ jobs:
64
65
  runs-on: macos-14
65
66
  if: ${{ github.event.inputs.platform == 'iOS' }}
66
67
  steps:
68
+ - uses: cobrowseio/actions/.github/actions/git-auth@master
69
+ id: app-token
70
+ with:
71
+ client-id: ${{ vars.COBROWSE_BOT_CLIENT_ID }}
72
+ private-key: ${{ secrets.COBROWSE_BOT_KEY }}
73
+ permission-contents: write
74
+
67
75
  - name: Checkout repository
68
- uses: actions/checkout@v3
76
+ uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
69
77
  with:
70
- token: ${{ secrets.GH_REPO_TOKEN }}
78
+ token: ${{ steps.app-token.outputs.token }}
71
79
 
72
80
  - name: Get the new iOS version from the input parameter
73
81
  if: "${{ github.event.inputs.cobrowse_sdk_version != '' }}"
@@ -82,21 +90,19 @@ jobs:
82
90
  - name: Update Podspec file
83
91
  run: sed -i '.bak' "s/\(s\.dependency\ *'CobrowseIO\/XCFramework'\,\ *'\).*/\\1${COBROWSE_VERSION}'/" cobrowse-sdk-react-native.podspec
84
92
 
85
- # If the SDK was updated, commit the changes and open a new pull request
86
- - name: Create a new pull request
93
+ # If the SDK was updated, commit the changes back to the repo
94
+ - name: Commit the changes
87
95
  env:
88
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89
96
  FILES_TO_COMMIT: cobrowse-sdk-react-native.podspec
90
- NEW_BRANCH_NAME: feature/update_packages_${{ github.run_id }}
91
97
  run: |
92
98
  if [[ `git status --porcelain $FILES_TO_COMMIT` ]]; then
93
- git config --local user.name "Cobrowse.io Bot"
94
- git config --local user.email "github@cobrowse.io"
95
- git checkout -b $NEW_BRANCH_NAME
96
99
  git add $FILES_TO_COMMIT
97
- git commit -m "feat: update Cobrowse.io SDK"
98
- git push origin $NEW_BRANCH_NAME
99
- gh pr create -B master -H $NEW_BRANCH_NAME --title 'Update native iOS SDKs' --body ''
100
+ git commit -m "feat: update Cobrowse iOS SDK to ${COBROWSE_VERSION}"
101
+ # Pull the changes that might have been commited during this run
102
+ git config pull.rebase true
103
+ git config rebase.autoStash true
104
+ git pull origin
105
+ git push
100
106
  else
101
107
  echo "No changes to commit"
102
108
  fi
@@ -0,0 +1,6 @@
1
+ {
2
+ "recommendations": [
3
+ "standard.vscode-standard",
4
+ "msjsdiag.vscode-react-native"
5
+ ]
6
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Attach to Hermes application",
6
+ "cwd": "${workspaceFolder}/Example",
7
+ "type": "reactnativedirect",
8
+ "request": "attach"
9
+ }
10
+ ]
11
+ }
@@ -3,5 +3,5 @@
3
3
  "prettier.enable": false,
4
4
  "standard.enable": true,
5
5
  "standard.autoFixOnSave": true,
6
- "standard.engine": "standard"
6
+ "standard.engine": "ts-standard"
7
7
  }