-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add an output locked
#135
Conversation
src/lock.ts
Outdated
@@ -14,16 +14,20 @@ export const lock = async (input: lib.Input) => { | |||
switch (result) { | |||
case Result.AlreadyLocked: | |||
core.setOutput("already_locked", true); | |||
core.setOutput("locked", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be false
.
locked
should be true only if the step has acquired a lock.
@@ -20,6 +20,7 @@ export const check = async (input: lib.Input) => { | |||
core.setOutput("result", s); | |||
core.info(`result: ${s}`); | |||
const alreadyLocked = metadata?.state === "lock"; | |||
core.setOutput("locked", alreadyLocked); | |||
core.setOutput("already_locked", alreadyLocked); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I want to remove already_locked
if mode
is check
, but it's a breaking change.
🚀 Pre-release v0.1.4-5 was createdYou can try the pre-release version in your workflows by changing version to |
Add an output
locked
ifmode
is eitherlock
orcheck
.This output is useful for other GitHub Actions jobs to check if the job acquires the lock.
e.g.