Skip to content

Commit db3d24d

Browse files
committed
ci: update release with secret and target repo (#1081)
1 parent a617df9 commit db3d24d

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

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

Lines changed: 23 additions & 6 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
flutter_version:
812
description: "New Flutter SDK Version (e.g., 5.3.4 or 5.3.4-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
flutter_version:
@@ -46,22 +50,30 @@ 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+
GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
4956
with:
57+
# Need target_repo otherwise caller would set github.repository to the caller itself (e.g. sdk-actions)
58+
target_repo: OneSignal/OneSignal-Flutter-SDK
5059
version: ${{ inputs.flutter_version }}
5160

52-
update-version:
61+
update_version:
5362
needs: prep
5463
runs-on: macos-latest
5564
outputs:
56-
flutter_from: ${{ steps.current_versions.outputs.cordova_from }}
65+
flutter_from: ${{ steps.current_versions.outputs.flutter_from }}
5766
android_from: ${{ steps.current_versions.outputs.android_from }}
5867
ios_from: ${{ steps.current_versions.outputs.ios_from }}
5968

6069
steps:
6170
- name: Checkout
6271
uses: actions/checkout@v5
6372
with:
73+
# Need repository otherwise caller would set github.repository to the caller itself (e.g. sdk-actions)
74+
repository: OneSignal/OneSignal-Flutter-SDK
6475
ref: ${{ needs.prep.outputs.release_branch }}
76+
token: ${{ secrets.GH_PUSH_TOKEN || github.token }}
6577

6678
- name: Get current native SDK versions
6779
id: current_versions
@@ -152,12 +164,17 @@ jobs:
152164
git push
153165
154166
create-pr:
155-
needs: [prep, update-version]
167+
needs: [prep, update_version]
156168
uses: OneSignal/sdk-actions/.github/workflows/create-release.yml@main
169+
secrets:
170+
# Need this cross-repo token (sdk-actions & this repo) to perform changes
171+
GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
157172
with:
173+
# Need target_repo otherwise caller would set github.repository to the caller itself (e.g. sdk-actions)
174+
target_repo: OneSignal/OneSignal-Flutter-SDK
158175
release_branch: ${{ needs.prep.outputs.release_branch }}
159176
target_branch: ${{ inputs.target_branch }}
160-
android_from: ${{ needs.update-version.outputs.android_from }}
177+
android_from: ${{ needs.update_version.outputs.android_from }}
161178
android_to: ${{ inputs.android_version }}
162-
ios_from: ${{ needs.update-version.outputs.ios_from }}
179+
ios_from: ${{ needs.update_version.outputs.ios_from }}
163180
ios_to: ${{ inputs.ios_version }}

0 commit comments

Comments
 (0)