Skip to content

Commit

Permalink
chore: more debugging options
Browse files Browse the repository at this point in the history
  • Loading branch information
FabiLo22 committed Dec 4, 2024
1 parent 7267504 commit f57cfc7
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 16 deletions.
29 changes: 24 additions & 5 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "typescript-action",
"description": "Givve Automatic Deployment",
"version": "v0.1.9",
"version": "v0.1.11",
"author": "PL Gutscheinsysteme GmbH",
"private": true,
"homepage": "https://github.com/givve/github_deployment_action",
Expand Down
15 changes: 12 additions & 3 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export class GitHub {
}
)

resolve(issue.html_url)
if (error) {
console.log(error)
reject(error)
} else {
resolve(issue.html_url)
}
})
}

Expand All @@ -49,8 +54,12 @@ export class GitHub {
pull_number: core.getInput('pull_request')
}
)

resolve(issue.labels.map((label: any) => label.name))
if (error) {
console.log(error)
reject(error)
} else {
resolve(issue.labels.map((label: any) => label.name))
}
})
}
}
19 changes: 13 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,24 @@ export async function run(): Promise<void> {
let lock = await getLock(component + '_deploy')
// No lock, we need to lock deployment
if (!lock) {
const { data } = await setLock(component, url)
lock = data.data
core.setOutput(
'lock_msg',
'Manual deployment enabled! Automatic deployment disabled!'
)
try {
const { data } = await setLock(component + '_deploy', url)

lock = data.data
core.setOutput(
'lock_msg',
'Manual deployment enabled! Automatic deployment disabled!'
)
core.setOutput('github_pr', url)
} catch (error) {
console.log(error)
}
} else {
core.setOutput(
'lock_msg',
'Deployment already locked! Please check PR!'
)
core.setOutput('github_pr', lock.purpose)
}

// Manual deployment, so deployment is not permitted
Expand Down

0 comments on commit f57cfc7

Please sign in to comment.