Skip to content

Commit 3338b94

Browse files
authored
ci: update create release to use gh push token and target repo (#1861)
1 parent 0142300 commit 3338b94

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/create-release-pr.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Create Release PR
33
on:
44
# For making a release pr from android / ios sdk actions
55
workflow_call:
6+
secrets:
7+
GH_PUSH_TOKEN:
8+
required: false
9+
description: 'GitHub token for pushing changes'
610
inputs:
711
rn_version:
812
description: 'New React Native Version (e.g., 5.2.15 or 5.2.15-beta.1)'
@@ -22,7 +26,7 @@ on:
2226
type: string
2327
default: main
2428

25-
# For making a release pr from cordova github actions
29+
# For making a release pr from the github actions
2630
workflow_dispatch:
2731
inputs:
2832
rn_version:
@@ -46,11 +50,16 @@ on:
4650
jobs:
4751
prep:
4852
uses: OneSignal/sdk-actions/.github/workflows/prep-release.yml@main
53+
secrets:
54+
# Need this cross-repo token (sdk-actions & this repo) to perform changes
55+
56+
GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
4957
with:
58+
target_repo: OneSignal/react-native-onesignal
5059
version: ${{ inputs.rn_version }}
5160

5261
# React Native specific steps
53-
update-version:
62+
update_version:
5463
needs: prep
5564
runs-on: macos-latest
5665
outputs:
@@ -62,7 +71,10 @@ jobs:
6271
- name: Checkout
6372
uses: actions/checkout@v5
6473
with:
74+
# Need repository otherwise caller would set github.repository to the caller itself (e.g. sdk-actions)
75+
repository: OneSignal/react-native-onesignal
6576
ref: ${{ needs.prep.outputs.release_branch }}
77+
token: ${{ secrets.GH_PUSH_TOKEN || github.token }}
6678

6779
- name: Setup Bun
6880
uses: oven-sh/setup-bun@v2
@@ -79,7 +91,7 @@ jobs:
7991
- name: Get current native SDK versions
8092
id: current_versions
8193
run: |
82-
# Current cordova version
94+
# Current React Native version
8395
CURRENT_VERSION=$(jq -r .version package.json)
8496
8597
# Extract current Android SDK version
@@ -147,9 +159,14 @@ jobs:
147159
git push
148160
149161
create-pr:
150-
needs: [prep, update-version]
162+
needs: [prep, update_version]
151163
uses: OneSignal/sdk-actions/.github/workflows/create-release.yml@main
164+
secrets:
165+
# Need this cross-repo token (sdk-actions & this repo) to perform changes
166+
GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
152167
with:
168+
# Need target_repo otherwise caller would set github.repository to the caller itself (e.g. sdk-actions)
169+
target_repo: OneSignal/react-native-onesignal
153170
release_branch: ${{ needs.prep.outputs.release_branch }}
154171
target_branch: ${{ inputs.target_branch }}
155172
android_from: ${{ needs.update-version.outputs.android_from }}

0 commit comments

Comments
 (0)