Skip to content

Commit

Permalink
Merge branch 'master' of github.com:seek-oss/sku into update-lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
askoufis committed Nov 14, 2024
2 parents ffbddf2 + e0206c0 commit b326df3
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/sour-otters-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'sku': patch
---

Update `env-ci` dependency to `^11.1.0`
1 change: 0 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
matchUpdateTypes: 'major',
matchPackageNames: [
'chalk',
'env-ci',
'escape-string-regexp',
'find-up',
'get-port',
Expand Down
5 changes: 3 additions & 2 deletions packages/sku/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"babel-plugin-transform-remove-imports": "^1.7.0",
"babel-plugin-unassert": "^3.1.0",
"browserslist": "^4.16.1",
"browserslist-config-seek": "3.1.0",
"browserslist-config-seek": "3.2.0",
"chalk": "^4.1.0",
"cross-spawn": "^7.0.3",
"css-loader": "^6.7.1",
Expand All @@ -95,7 +95,7 @@
"default-browser": "^5.2.1",
"didyoumean2": "^7.0.2",
"ensure-gitignore": "^1.1.2",
"env-ci": "^7.0.0",
"env-ci": "^11.1.0",
"esbuild": ">0.19.7 <1",
"esbuild-register": "^3.3.3",
"escape-string-regexp": "^4.0.0",
Expand Down Expand Up @@ -146,6 +146,7 @@
"devDependencies": {
"@types/cross-spawn": "^6.0.3",
"@types/debug": "^4.1.12",
"@types/env-ci": "^3.1.4",
"@types/eslint": "^8.56.10",
"@types/minimist": "^1.2.5",
"@types/node": "^18.19.31",
Expand Down
15 changes: 9 additions & 6 deletions packages/sku/scripts/translations.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
const envCi = require('env-ci');

const { branch } = envCi();
const chalk = require('chalk');
const {
argv: args,
Expand All @@ -23,13 +20,19 @@ if (!commandArguments) {
);
}

const ensureBranch = () => {
const ensureBranch = async () => {
const { default: envCi } = await import('env-ci');
const { branch } = envCi();

if (!branch) {
throw new Error(
'Unable to determine branch from environment variables. Branch is required for this command.',
);
}

console.log(`Using branch ${branch} for Phrase translations`);

return branch;
};

(async () => {
Expand Down Expand Up @@ -62,11 +65,11 @@ const ensureBranch = () => {
validate(vocabConfig);
}
if (translationSubCommand === 'push') {
ensureBranch();
const branch = await ensureBranch();
push({ branch, deleteUnusedKeys }, vocabConfig);
}
if (translationSubCommand === 'pull') {
ensureBranch();
const branch = await ensureBranch();
pull({ branch }, vocabConfig);
}
} catch (e) {
Expand Down
33 changes: 25 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b326df3

Please sign in to comment.