Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- fix run_app_build path escaping
  • Loading branch information
StephenHodgson authored Dec 24, 2024
1 parent 0ac94d1 commit fbd84a0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 25 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26485,7 +26485,7 @@ async function getCommandArgs() {
let appBuildPath = core.getInput('app_build');
if (appBuildPath) {
await fs.promises.access(appBuildPath, fs.constants.R_OK);
args.push('+run_app_build', `"${appBuildPath}"`, '+quit');
args.push('+run_app_build', appBuildPath, '+quit');
return args;
}
let workshopItemPath = core.getInput('workshop_item');
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "upload-steam",
"version": "1.0.2",
"version": "1.0.3",
"description": "A GitHub Action for uploading an app build or workshop item to Steam.",
"author": "RageAgainstThePixel",
"repository": {
Expand Down
21 changes: 1 addition & 20 deletions src/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,59 +18,44 @@ async function getCommandArgs(): Promise<string[]> {
let args = [];
const username = core.getInput('username', { required: true });
args.push('+login', username);

let appBuildPath = core.getInput('app_build');

if (appBuildPath) {
await fs.promises.access(appBuildPath, fs.constants.R_OK);
args.push('+run_app_build', `"${appBuildPath}"`, '+quit');
args.push('+run_app_build', appBuildPath, '+quit');
return args;
}

let workshopItemPath = core.getInput('workshop_item');

if (workshopItemPath) {
await fs.promises.access(workshopItemPath, fs.constants.R_OK);
args.push('+workshop_build_item', workshopItemPath, '+quit');
return args;
}

const appId = core.getInput('app_id', { required: true });
const contentRoot = path.resolve(core.getInput('content_root') || WORKSPACE);
await fs.promises.access(contentRoot, fs.constants.R_OK);
const description = core.getInput('description');

const workshopItemId = core.getInput('workshop_item_id');

if (workshopItemId) {
workshopItemPath = await generateWorkshopItemVdf(appId, workshopItemId, contentRoot, description);
args.push('+workshop_build_item', workshopItemPath, '+quit');
return args;
}

const set_live = core.getInput('set_live');

const depot_file_exclusions = core.getInput('depot_file_exclusions');
let depot_file_exclusions_list = undefined;

if (depot_file_exclusions) {
depot_file_exclusions_list = depot_file_exclusions.split('\n');
}

const install_scripts = core.getInput('install_scripts');
let install_scripts_list = undefined;

if (install_scripts) {
install_scripts_list = install_scripts.split('\n');
}

const depots = core.getInput('depots');
let depots_list = undefined;

if (depots) {
depots_list = depots.split('\n');
}

appBuildPath = await generateBuildVdf(appId, contentRoot, description, set_live, depot_file_exclusions_list, install_scripts_list, depots_list);
args.push('+run_app_build', appBuildPath, '+quit');
return args;
Expand Down Expand Up @@ -124,23 +109,19 @@ async function generateBuildVdf(appId: string, contentRoot: string, description:
appBuild += `\t\t\t"FileExclusion" "*.pdb" // don't include symbols\n`;
appBuild += `\t\t\t"FileExclusion" "**/*_BurstDebugInformation_DoNotShip*" // don't include unity build folders\n`;
appBuild += `\t\t\t"FileExclusion" "**/*_BackUpThisFolder_ButDontShipItWithYourGame*" // don't include unity build folders\n`;

if (depot_file_exclusions_list) {
depot_file_exclusions_list.forEach(exclusion => {
appBuild += `\t\t\t"FileExclusion" "${exclusion}"\n`;
});
}

if (install_scripts_list) {
install_scripts_list.forEach(script => {
appBuild += `\t\t\t"InstallScript" "${script}"\n`;
});
}

appBuild += `\t\t}\n`;
appBuild += `\t}\n`;
}

appBuild += '}';
core.info(appBuild);
await fs.promises.writeFile(appBuildPath, appBuild);
Expand Down

0 comments on commit fbd84a0

Please sign in to comment.