Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 2 additions & 15 deletions .github/scripts/stable-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,9 @@ async function runGitCommands() {
await exec(`git checkout origin/${baseBranch} -- package.json`);
console.log(`Executed: git checkout origin/${baseBranch} -- package.json`);
}
// Execute extension-specific commands if REPO is 'extension'
else if (process.env.REPO === 'extension') {
console.log('Executing extension-specific commands...');

const { stdout: packageJsonContent } = await exec(
`git show origin/${baseBranch}:package.json`,
);
const packageJson = JSON.parse(packageJsonContent);
const packageVersion = packageJson.version;

await exec(`yarn version "${packageVersion}"`);
console.log('Executed: yarn version');
}
// If REPO is not set or has an invalid value, skip both
// If REPO is not set or is 'extension', skip repo-specific commands
else {
console.log('REPO environment variable not set or invalid. Skipping mobile/extension specific commands.');
console.log('No repo-specific commands to execute.');
}

await exec('git add .');
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/stable-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,17 @@ jobs:
REPO: ${{ inputs.repo-type }} # Default to 'mobile' if not specified
BASE_BRANCH: ${{ inputs.stable-branch-name }}
run: |
# Ensure github-tools is in .gitignore to prevent it from being committed
if ! grep -q "^github-tools/" .gitignore 2>/dev/null; then
echo "github-tools/" >> .gitignore
echo "Added github-tools/ to .gitignore"
fi

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Gitignore Overwritten by Git Commands Reinstating Exclusions

The workflow adds github-tools/ to .gitignore to prevent its commitment. However, the stable-sync.js script's git commands restore files from origin/main, overwriting .gitignore and undoing the exclusion. This means github-tools/ may still be committed.

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XxdpavelxX is this a valid comment?

Copy link
Contributor Author

@XxdpavelxX XxdpavelxX Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I don't think it's relevant. We're adding github-tools/ to .gitignore in mobile, extension also so it shouldn't be an issue once we do that.

# Execute the script from github-tools
node ./github-tools/.github/scripts/stable-sync.js "stable-main-${{ inputs.semver-version }}"
# Check if branch exists remotely
echo "Cleaning up github-tools"
rm -rf github-tools
BRANCH_NAME="stable-main-${{ inputs.semver-version }}"
if git ls-remote --heads origin "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
git pull --rebase
echo "Branch $BRANCH_NAME exists remotely, pushing normally"
echo "Branch $BRANCH_NAME exists remotely, force pushing to overwrite"
git push origin "$BRANCH_NAME" --force
else
echo "Branch $BRANCH_NAME doesn't exist remotely, pushing with --set-upstream"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/update-release-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,3 @@ jobs:
"${{ inputs.platform }}" \
"${{ inputs.repository-url }}" \
"${{ inputs.previous-version-ref }}"

Loading