Skip to content

Commit

Permalink
read the GitHub server URL from the 'GITHUB_SERVER_URL' env variable (#…
Browse files Browse the repository at this point in the history
…835)

Signed-off-by: Christian Rauch <Christian.Rauch@de.bosch.com>
  • Loading branch information
christian-rauch authored Nov 9, 2023
1 parent 38c12d5 commit 67b4ac4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11554,12 +11554,13 @@ done`;
// if ref is set this overrides anything calculated above
commitRef = core.getInput("ref") || commitRef;
const repoFilePath = path.join(rosWorkspaceDir, "package.repo");
const githubServerUrl = process.env.GITHUB_SERVER_URL;
// Add a random string prefix to avoid naming collisions when checking out the test repository
const randomStringPrefix = Math.random().toString(36).substring(2, 15);
const repoFileContent = `repositories:
${randomStringPrefix}/${repo["repo"]}:
type: git
url: 'https://github.com/${repoFullName}.git'
url: '${githubServerUrl}/${repoFullName}.git'
version: '${commitRef}'`;
fs_1.default.writeFileSync(repoFilePath, repoFileContent);
yield execShellCommand(["vcs import --force --recursive src/ < package.repo"], options);
Expand Down
3 changes: 2 additions & 1 deletion src/action-ros-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,13 @@ done`;
// if ref is set this overrides anything calculated above
commitRef = core.getInput("ref") || commitRef;
const repoFilePath = path.join(rosWorkspaceDir, "package.repo");
const githubServerUrl = process.env.GITHUB_SERVER_URL as string;
// Add a random string prefix to avoid naming collisions when checking out the test repository
const randomStringPrefix = Math.random().toString(36).substring(2, 15);
const repoFileContent = `repositories:
${randomStringPrefix}/${repo["repo"]}:
type: git
url: 'https://github.com/${repoFullName}.git'
url: '${githubServerUrl}/${repoFullName}.git'
version: '${commitRef}'`;
fs.writeFileSync(repoFilePath, repoFileContent);
await execShellCommand(
Expand Down

0 comments on commit 67b4ac4

Please sign in to comment.