Skip to content

Commit

Permalink
Use the project domain as site-url not the siteUrl of the webspace fo…
Browse files Browse the repository at this point in the history
…r the production branch
  • Loading branch information
coder-hugo committed Jun 25, 2021
1 parent e2bd733 commit ac5eaa1
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,25 @@ try {
}

function retrieveProjectInfo(counter) {
instance.get(`/v1/projects/${project}/branches`, { params: { name: branchName } })
instance.get(`/v1/projects/${project}`)
.then(res => {
const branches = res.data.values.filter(branch => branch.name === branchName);
const project = res.data;
if (project.productionBranch.name === branchName) {
const branch = project.productionBranch;
console.log(`site-url: https://${project.domain}`)
core.setOutput("site-url", `https://${project.domain}`);
console.log(`remote-host: ${branch.webSpace.sshHost}`)
core.setOutput("remote-host", branch.webSpace.sshHost);
console.log(`branch-id: ${branch.id}`)
core.setOutput("branch-id", branch.id);
console.log(`storage-quota: ${branch.webSpaceQuota.storageQuota}`)
core.setOutput("storage-quota", branch.webSpaceQuota.storageQuota);
console.log(`deployment-enabled: true`)
core.setOutput("deployment-enabled", true);
return;
}

const branches = project.branches.filter(branch => branch.name === branchName);
if (branches.length === 0) {
if (counter === 0) {
core.setFailed(`Branch ${branchName} not found in IONOS.space`);
Expand Down

0 comments on commit ac5eaa1

Please sign in to comment.