Used inputs
This commit is contained in:
11
action.yml
11
action.yml
@@ -5,10 +5,13 @@ author: Skydust
|
|||||||
# Define your inputs here.
|
# Define your inputs here.
|
||||||
inputs:
|
inputs:
|
||||||
branchesToIgnore:
|
branchesToIgnore:
|
||||||
description: The username
|
description: Comma separated branches to ignore
|
||||||
required: true
|
default: "dev,main,master"
|
||||||
branchesToRebaseOn:
|
required: false
|
||||||
description: ""
|
mainBranch:
|
||||||
|
description: "The main branch to rebase on"
|
||||||
|
default: "dev"
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node20'
|
||||||
|
|||||||
7
app.ts
7
app.ts
@@ -1,10 +1,11 @@
|
|||||||
import { spawn } from "child_process";
|
import { spawn } from "child_process";
|
||||||
import { ChildProcess, SpawnOptions } from "node:child_process";
|
import { ChildProcess, SpawnOptions } from "node:child_process";
|
||||||
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
// Ignored branches
|
// Ignored branches
|
||||||
const IGNORED_BRANCHES = ["master", "main", "dev", "release"];
|
const IGNORED_BRANCHES: string[] = core.getInput('branchesToIgnore', { required: false }).split(",");
|
||||||
|
|
||||||
const mainBranch = "dev";
|
const mainBranch: string = core.getInput('mainBranch', { required: false });
|
||||||
|
|
||||||
enum Action {
|
enum Action {
|
||||||
Rebase = 0,
|
Rebase = 0,
|
||||||
@@ -78,6 +79,7 @@ const buildRebaseDependencyGraph = async (branches: string[]): Promise<Record<st
|
|||||||
const commitHistories: Record<string, Set<string>> = {};
|
const commitHistories: Record<string, Set<string>> = {};
|
||||||
for (const branch of branches) {
|
for (const branch of branches) {
|
||||||
commitHistories[branch] = await getCommitsForBranch(branch);
|
commitHistories[branch] = await getCommitsForBranch(branch);
|
||||||
|
console.log(commitHistories[branch]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let finalBranches: Record<string, BranchWithDependencies> = {};
|
let finalBranches: Record<string, BranchWithDependencies> = {};
|
||||||
@@ -115,6 +117,7 @@ const buildRebaseDependencyGraph = async (branches: string[]): Promise<Record<st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(finalBranches);
|
||||||
|
|
||||||
// Set rebase for branches with no dependencies
|
// Set rebase for branches with no dependencies
|
||||||
for (const branch of branches) {
|
for (const branch of branches) {
|
||||||
|
|||||||
19817
dist/app.js
vendored
19817
dist/app.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user