Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
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
25 changes: 16 additions & 9 deletions .github/scripts/create-platform-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ if [[ -z $NEW_VERSION_NUMBER && $PLATFORM == "mobile" ]]; then
fi




# Helper Functions
# ---------------

Expand Down Expand Up @@ -74,12 +72,15 @@ get_release_branch_name() {
return 0
fi

# Different release branch naming for different platforms
if [[ "$platform" == "mobile" ]]; then
echo "release/${new_version}"
elif [[ "$platform" == "extension" ]]; then
echo "Version-v${new_version}"
fi
# Use consistent release branch naming for all platforms
echo "release/${new_version}"

# Different release branch naming for different platforms, commented in case of need it
# if [[ "$platform" == "mobile" ]]; then
# echo "release/${new_version}"
# elif [[ "$platform" == "extension" ]]; then
# echo "Version-v${new_version}"
# fi
}

# Main Script
Expand Down Expand Up @@ -224,7 +225,13 @@ cd ../
# Commit and Push Changelog Changes
# -------------------------------
echo "Adding and committing changes.."
git add ./commits.csv
# Add commits.csv file if it exists
if [ -f "./commits.csv" ]; then
echo "commits.csv found, adding to git..."
git add ./commits.csv
else
echo "--> commits.csv not found, skipping..."
fi


if ! (git commit -am "updated changelog and generated feature test plan");
Expand Down
39 changes: 39 additions & 0 deletions .github/scripts/generate-rc-commits.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,45 @@ async function filterCommitsByTeam(platform, branchA, branchB) {
try {
const git = simpleGit();

// Fetch all branches from remote to ensure we have the latest references
console.log('Fetching branches from remote...');
await git.fetch('origin', ['--all']);

// Check if branches exist
console.log(`Checking if branches exist: ${branchA} and ${branchB}`);

try {
await git.revparse(['--verify', branchA]);
console.log(`✓ Branch ${branchA} exists`);
} catch (error) {
console.error(`✗ Branch ${branchA} does not exist locally`);
// Try to check if it exists remotely
try {
await git.revparse(['--verify', `origin/${branchA}`]);
console.log(`✓ Branch origin/${branchA} exists, using remote reference`);
branchA = `origin/${branchA}`;
} catch (remoteError) {
console.error(`✗ Branch ${branchA} does not exists remotely either`);
throw new Error(`Branch ${branchA} not found locally or remotely`);
}
}

try {
await git.revparse(['--verify', branchB]);
console.log(`✓ Branch ${branchB} exists`);
} catch (error) {
console.error(`✗ Branch ${branchB} does not exist locally`);
// Try to check if it exists remotely
try {
await git.revparse(['--verify', `origin/${branchB}`]);
console.log(`✓ Branch origin/${branchB} exists, using remote reference`);
branchB = `origin/${branchB}`;
} catch (remoteError) {
console.error(`✗ Branch ${branchB} does not exists remotely either`);
throw new Error(`Branch ${branchB} not found locally or remotely`);
}
}

const logOptions = {
from: branchB,
to: branchA,
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ on:
type: string
description: 'The platform for which the release PR is being created.'
github-tools-version:
required: false
type: string
description: 'The version of github-tools to use. Defaults to main.'
default: 'main'
default: ${{ github.action_ref }}
secrets:
github-token:
required: true
Expand Down Expand Up @@ -104,6 +105,9 @@ jobs:
echo "Extension Template Sheet ID: ${{ inputs.extension-template-sheet-id }}"
echo "Release Sheet Google Document ID: ${{ inputs.release-sheet-google-document-id }}"
echo "GitHub Tools Version: ${{ inputs.github-tools-version }}"
echo "GitHub Action Ref: ${{ github.action_ref }}"
echo "GitHub Ref: ${{ github.ref }}"
echo "GitHub SHA: ${{ github.sha }}"
echo "-------------"

# Step 5: Create Release PR
Expand Down
Loading