Skip to content

Commit

Permalink
Test new keys
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Feb 1, 2025
1 parent e46084c commit 8ef5602
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
25 changes: 6 additions & 19 deletions action/src/workflows/pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ export class PullRequestWorkflow implements GitWorkflow {
// Get base branch from config
const { baseBranch } = this.gitProvider.getPlatformConfig();

// Make sure we're on the base branch first
logger.info(`Checking out base branch ${baseBranch}`);
await this.#fetchAndCheckoutBaseBranch(baseBranch);

// Run translation service on base branch to detect changes
logger.info("Running translation service to detect changes...");
await this.translationService.runTranslation(this.config);

// Check if we have any changes before proceeding
const hasChanges = await this.gitProvider.hasChanges();
if (!hasChanges) {
logger.info("No translation changes detected, skipping PR creation");
return;
}

// Now handle the feature branch
const branchExists = await this.#checkBranchExists(this.branchName);
logger.info(branchExists ? "Branch exists" : "Branch does not exist");
Expand All @@ -53,9 +38,6 @@ export class PullRequestWorkflow implements GitWorkflow {
logger.info(`Creating new branch ${this.branchName}`);
await this.#createNewBranch(this.branchName, baseBranch);
}

// Stage the changes we detected
await this.gitProvider.addChanges();
} catch (error) {
logger.error(error instanceof Error ? error.message : "Unknown error");
throw error;
Expand All @@ -66,11 +48,16 @@ export class PullRequestWorkflow implements GitWorkflow {
logger.info("Running pull request workflow...");

try {
// Run translation service to generate changes
logger.info("Running translation service...");
await this.translationService.runTranslation(this.config);

// Check if we have any changes to commit
const hasChanges = await this.gitProvider.hasChanges();

if (hasChanges) {
logger.info("Changes detected, committing and pushing...");
await this.gitProvider.addChanges();
await this.gitProvider.commitAndPush({
message: this.config.commitMessage,
branch: this.branchName,
Expand Down Expand Up @@ -181,7 +168,7 @@ export class PullRequestWorkflow implements GitWorkflow {
execSync(`git reset --hard origin/${baseBranch}`, { stdio: "inherit" });

logger.info("Restoring target files");
const targetFiles = ["i18n.lock"];
const targetFiles = ["languine.lock"];
execSync(`git fetch origin ${this.branchName}`, { stdio: "inherit" });

// Restore each file from the feature branch
Expand Down
2 changes: 1 addition & 1 deletion apps/web/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#############
##############

0 comments on commit 8ef5602

Please sign in to comment.