Skip to content

Commit 4ff7c77

Browse files
committed
trigger-frontend-updates:typescript@5.9.2
1 parent 3ae7024 commit 4ff7c77

3 files changed

Lines changed: 15 additions & 19 deletions

File tree

.github/workflows/frontend-updates-runner.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
cache: "pnpm"
2828
cache-dependency-path: frontend-updates-runner/pnpm-lock.yaml
2929

30+
- name: Install corepack
31+
run: |
32+
npm install --global corepack@latest
33+
corepack enable
34+
3035
- name: Install dependencies
3136
run: |
3237
cd frontend-updates-runner

packages/frontend-updates-runner/src/package-manager.ts

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import { join } from "path";
33

44
type PackageManager = "npm" | "yarn" | "pnpm" | "unknown";
55

6-
export function getPackageManager({
7-
repoPath,
8-
}: {
9-
repoPath: string;
10-
}): PackageManager {
6+
export function getPackageManager({ repoPath }: { repoPath: string }): PackageManager {
117
try {
128
const packageLockfile = statSync(join(repoPath, "package-lock.json"));
139
if (packageLockfile.isFile()) {
@@ -30,11 +26,7 @@ export function getPackageManager({
3026
return "unknown";
3127
}
3228

33-
export function getPackageManagerInstallCommand({
34-
packageManager,
35-
}: {
36-
packageManager: PackageManager;
37-
}): string {
29+
export function getPackageManagerInstallCommand({ packageManager }: { packageManager: PackageManager }): string {
3830
switch (packageManager) {
3931
case "npm":
4032
return "npm install";
@@ -47,11 +39,7 @@ export function getPackageManagerInstallCommand({
4739
}
4840
}
4941

50-
function getPackageManagerAddCommand({
51-
packageManager,
52-
}: {
53-
packageManager: PackageManager;
54-
}): string {
42+
function getPackageManagerAddCommand({ packageManager }: { packageManager: PackageManager }): string {
5543
switch (packageManager) {
5644
case "npm":
5745
return "npm install";
@@ -80,10 +68,8 @@ export function getPackageManagerUpdateCommand({
8068
})} ${packageName}@${packageVersion}`;
8169
switch (packageManager) {
8270
case "yarn":
83-
const yarnWorkspaces = JSON.parse(
84-
readFileSync(join(repoPath, "package.json"), "utf8"),
85-
).workspaces;
86-
if (yarnWorkspaces) {
71+
const yarnWorkspaces = JSON.parse(readFileSync(join(repoPath, "package.json"), "utf8")).workspaces;
72+
if (yarnWorkspaces && packageVersion.startsWith("1.")) {
8773
return `${addCommand} -W`;
8874
} else {
8975
return addCommand;

packages/frontend-updates-runner/src/update-depency-in-repos.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export async function updateDependencyInRepos({
3232
try {
3333
console.log(`Working on repository: ${repository.full_name}`);
3434

35+
if (!repository.full_name.endsWith("front")) {
36+
console.log(`Skipping repository: ${repository.full_name}`);
37+
continue;
38+
}
39+
3540
const { token, octokitWithAuth } = await getTokenAndOctokitWithAuth({
3641
octokit,
3742
installationId: installation.id,

0 commit comments

Comments
 (0)