Skip to content

Commit 06f5f40

Browse files
committed
force push
1 parent 7deb814 commit 06f5f40

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.github/workflows/bump-native-version.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
sed -i "s/OneSignalXCFramework\" version=\"[0-9.]\+/OneSignalXCFramework\" version=\"${IOS_NEW}/g" \
6565
com.onesignal.unity.ios/Editor/OneSignaliOSDependencies.xml
6666
67-
- name: Gather and combine release notes
67+
- name: Gather and combine release notes
6868
id: combined
6969
uses: actions/github-script@v8
7070
env:
@@ -80,16 +80,21 @@ jobs:
8080
console.log(`🔎 Gathering release notes for ${repo} from ${from} → ${to}`);
8181
const [owner, name] = repo.split('/');
8282
const releases = await github.paginate(github.rest.repos.listReleases, {
83-
owner, repo: name, per_page: 100
83+
owner,
84+
repo: name,
85+
per_page: 100
8486
});
8587
86-
const normalize = t => t.replace(/^Release /, '');
88+
// Normalize "Release 5.2.15" → "5.2.15"
89+
const normalize = tag => tag.replace(/^Release\s*/i, '').trim();
90+
8791
const tags = releases.map(r => normalize(r.tag_name));
8892
const startIndex = tags.indexOf(from);
8993
const endIndex = tags.indexOf(to);
9094
9195
if (startIndex === -1 || endIndex === -1) {
9296
console.warn(`⚠️ Could not find tags ${from} or ${to} in ${repo}`);
97+
console.warn('Available tags:', tags.slice(0, 10));
9398
return '';
9499
}
95100
@@ -99,7 +104,11 @@ jobs:
99104
}).reverse();
100105
101106
return selected
102-
.map(r => `- ### ${normalize(r.tag_name)}\n${r.body || '_No notes provided._'}`)
107+
.map(r => {
108+
const tag = normalize(r.tag_name);
109+
const body = r.body?.trim() || '_No release notes provided._';
110+
return `- ### ${tag}\n${body}`;
111+
})
103112
.join('\n\n');
104113
};
105114
@@ -147,13 +156,14 @@ jobs:
147156
git config user.email "github-actions[bot]@users.noreply.github.com"
148157
149158
BRANCH="bump-native-${{ inputs.android_version }}-${{ inputs.ios_version }}"
150-
git checkout -b "$BRANCH"
159+
git checkout -B "$BRANCH" # create or reset local branch to latest
151160
git add .
152-
git commit -m "Bump native OneSignal SDKs; OneSignal-Android-SDK ${{ inputs.android_version }}, OneSignal-iOS-SDK ${{ inputs.ios_version }}"
153-
git push origin "$BRANCH"
161+
git commit -m "Bump native OneSignal SDKs; OneSignal-Android-SDK ${{ inputs.android_version }}, OneSignal-iOS-SDK ${{ inputs.ios_version }}" || echo "No changes to commit"
162+
git push origin "$BRANCH" --force
154163
155164
gh pr create \
156165
--title "Bump native OneSignal SDKs; OneSignal-Android-SDK ${{ inputs.android_version }}, OneSignal-iOS-SDK ${{ inputs.ios_version }}" \
157166
--body "${{ steps.combined.outputs.combined }}" \
158167
--base main \
159-
--label "native-sdk-bump"
168+
--label "native-sdk-bump" || echo "PR already exists, skipping creation"
169+

0 commit comments

Comments
 (0)