Skip to content

Commit 7c8e2c3

Browse files
committed
polish
1 parent 457741c commit 7c8e2c3

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

dist/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37003,10 +37003,10 @@ async function run() {
3700337003
throw new Error('GitHub token is required. Please provide a token with appropriate permissions.');
3700437004
}
3700537005
if (updateFromSource) {
37006-
await updateFromSourceFlow(token, branch, autoMerge);
37006+
await updateFromSourceSpec(token, branch, autoMerge);
3700737007
}
3700837008
else {
37009-
await syncFilesFlow(token, branch, autoMerge);
37009+
await updateTargetSpec(token, branch, autoMerge);
3701037010
}
3701137011
}
3701237012
catch (error) {
@@ -37018,13 +37018,12 @@ async function run() {
3701837018
}
3701937019
}
3702037020
}
37021-
async function updateFromSourceFlow(token, branch, autoMerge) {
37021+
async function updateFromSourceSpec(token, branch, autoMerge) {
3702237022
if (!token) {
3702337023
throw new Error('GitHub token is required. Please provide a token with appropriate permissions.');
3702437024
}
3702537025
const owner = github.context.repo.owner;
3702637026
const repo = github.context.repo.repo;
37027-
const repository = `${owner}/${repo}`;
3702837027
try {
3702937028
await exec.exec('git', ['config', 'user.name', 'github-actions']);
3703037029
await exec.exec('git', ['config', 'user.email', '[email protected]']);
@@ -37052,7 +37051,7 @@ async function updateFromSourceFlow(token, branch, autoMerge) {
3705237051
throw new Error(`Failed to update from source: ${error instanceof Error ? error.message : 'Unknown error'}`);
3705337052
}
3705437053
}
37055-
async function syncFilesFlow(token, branch, autoMerge) {
37054+
async function updateTargetSpec(token, branch, autoMerge) {
3705637055
const repository = core.getInput('repository', { required: true });
3705737056
const fileMappingInput = core.getInput('sources', { required: true });
3705837057
let fileMapping;

src/sync.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export async function run(): Promise<void> {
4040
}
4141

4242
if (updateFromSource) {
43-
await updateFromSourceFlow(token, branch, autoMerge);
43+
await updateFromSourceSpec(token, branch, autoMerge);
4444
} else {
45-
await syncFilesFlow(token, branch, autoMerge);
45+
await updateTargetSpec(token, branch, autoMerge);
4646
}
4747
} catch (error) {
4848
if (error instanceof Error) {
@@ -53,14 +53,13 @@ export async function run(): Promise<void> {
5353
}
5454
}
5555

56-
async function updateFromSourceFlow(token: string, branch: string, autoMerge: boolean): Promise<void> {
56+
async function updateFromSourceSpec(token: string, branch: string, autoMerge: boolean): Promise<void> {
5757
if (!token) {
5858
throw new Error('GitHub token is required. Please provide a token with appropriate permissions.');
5959
}
6060

6161
const owner = github.context.repo.owner;
6262
const repo = github.context.repo.repo;
63-
const repository = `${owner}/${repo}`;
6463

6564
try {
6665
await exec.exec('git', ['config', 'user.name', 'github-actions']);
@@ -96,7 +95,7 @@ async function updateFromSourceFlow(token: string, branch: string, autoMerge: bo
9695
}
9796
}
9897

99-
async function syncFilesFlow(token: string, branch: string, autoMerge: boolean): Promise<void> {
98+
async function updateTargetSpec(token: string, branch: string, autoMerge: boolean): Promise<void> {
10099
const repository = core.getInput('repository', { required: true });
101100
const fileMappingInput = core.getInput('sources', { required: true });
102101
let fileMapping: SourceMapping[];

0 commit comments

Comments
 (0)