diff --git a/.github/scripts/stable-sync.js b/.github/scripts/stable-sync.js index d5544eb9..dd3fe2fe 100644 --- a/.github/scripts/stable-sync.js +++ b/.github/scripts/stable-sync.js @@ -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 .'); diff --git a/.github/workflows/stable-sync.yml b/.github/workflows/stable-sync.yml index e9fe15eb..71182f52 100644 --- a/.github/workflows/stable-sync.yml +++ b/.github/workflows/stable-sync.yml @@ -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 + # 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" diff --git a/.github/workflows/update-release-changelog.yml b/.github/workflows/update-release-changelog.yml index 8bf58f8d..bc76cda4 100644 --- a/.github/workflows/update-release-changelog.yml +++ b/.github/workflows/update-release-changelog.yml @@ -79,4 +79,3 @@ jobs: "${{ inputs.platform }}" \ "${{ inputs.repository-url }}" \ "${{ inputs.previous-version-ref }}" -