Skip to content

Commit

Permalink
chore: implement check or wait function
Browse files Browse the repository at this point in the history
  • Loading branch information
FabiLo22 committed Nov 19, 2024
1 parent f15c627 commit 38bb4d2
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 5 deletions.
65 changes: 64 additions & 1 deletion 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.6",
"version": "v0.1.7",
"author": "PL Gutscheinsysteme GmbH",
"private": true,
"homepage": "https://github.com/givve/github_deployment_action",
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ export async function run(): Promise<void> {
lock = data.data
}
// Manual deployment, so deployment is not permitted
core.setOutput('deployment_lock', lock.id + 'TEST')
core.setOutput('deployment_lock', lock.id)
}
} else {
await checkOrWait()
}
} catch (error) {
// Fail the workflow run if an error occurs
Expand Down
2 changes: 1 addition & 1 deletion src/wait.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function check(resolve: any, reject: any) {
} else {
if (lock.purpose === 'manual deployment lock') {
// Some other deployment is running, so we wait
core.setFailed('Manual deployment lock active! ID to unlock: ' + lock.id)
core.setOutput('deployment_lock', lock.id)
reject('Locked')
} else {
setTimeout(() => {
Expand Down

0 comments on commit 38bb4d2

Please sign in to comment.