Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split input.repo to get only repo name. #135

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dist/publish-crates-debian-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127723,8 +127723,10 @@ async function main(input) {
(0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`unzip ${archive} -d ${input.version}`);
}
}
// repo is actually owner/repo so we have to split it here to get only the git repo name
const gitRepo = input.repo.split("/")[1];
const debianRepo = `${input.sshHost}:${input.sshHostPath}`;
const packagesPath = `.Packages-${input.repo}-${input.version}`;
const packagesPath = `.Packages-${gitRepo}-${input.version}`;
const allPackagesPath = "Packages";
const allPackagesGzippedPath = "Packages.gz";
await _ssh__WEBPACK_IMPORTED_MODULE_4__/* .withIdentity */ .Y(input.sshPrivateKey, input.sshPassphrase, env => {
Expand Down
6 changes: 4 additions & 2 deletions src/publish-crates-debian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function setup(): Input {
const sshPrivateKey = core.getInput("ssh-private-key", { required: true });
const sshPassphrase = core.getInput("ssh-passphrase", { required: true });
const installationTest = core.getBooleanInput("installation-test", { required: true });
const repo = core.getInput("repo", {required: true});
const repo = core.getInput("repo", { required: true });

return {
liveRun,
Expand Down Expand Up @@ -71,8 +71,10 @@ export async function main(input: Input) {
}
}

// repo is actually owner/repo so we have to split it here to get only the git repo name
const gitRepo = input.repo.split("/")[1];
const debianRepo = `${input.sshHost}:${input.sshHostPath}`;
const packagesPath = `.Packages-${input.repo}-${input.version}`;
const packagesPath = `.Packages-${gitRepo}-${input.version}`;
const allPackagesPath = "Packages";
const allPackagesGzippedPath = "Packages.gz";

Expand Down
6 changes: 1 addition & 5 deletions src/ssh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ function setupAgent(): NodeJS.ProcessEnv {
return Object.fromEntries([...commands.matchAll(/([A-Z_]+)=([^;]+);/g)].map(m => [m[1], m[2]]));
}

export async function withIdentity(
privateKey: string,
passphrase: string,
fn: (env: NodeJS.ProcessEnv) => void,
) {
export async function withIdentity(privateKey: string, passphrase: string, fn: (env: NodeJS.ProcessEnv) => void) {
const env = setupAgent();
const passphrasePath = "./.ssh_askpass";
await fs.writeFile(passphrasePath, `echo '${passphrase}'`, { mode: fs.constants.S_IRWXU });
Expand Down