Giter Club home page Giter Club logo

Comments (17)

JoseThen avatar JoseThen commented on August 14, 2024 2

I should have time tomorrow, if it's fine with @styfle , I'll take another look at this.

from cancel-workflow-action.

obrassard avatar obrassard commented on August 14, 2024 1

@JoseThen Indeed, we would need this feature in obrassard/action-dokku-push (see : obrassard/action-dokku-push#5). To resume, we use cancel-workflow-action to cancel concurrent builds and we would need an output to know if a previous build was cancelled or not (because additional steps must be executed in this case).

from cancel-workflow-action.

JoseThen avatar JoseThen commented on August 14, 2024 1

That would be great to have, simple and concise.

from cancel-workflow-action.

styfle avatar styfle commented on August 14, 2024

Wouldn't it be better to use outputs instead?

Also, what would the value be?

from cancel-workflow-action.

styfle avatar styfle commented on August 14, 2024

Also see #23 (comment)

from cancel-workflow-action.

JoseThen avatar JoseThen commented on August 14, 2024

Wouldn't it be better to use outputs instead?

Also, what would the value be?

Using outputs sounds like the way to go. Going to have to test some more but wonder how I would get runningWorkflows.length as a value. That way I can add that as the output and run some commands based on the value.

from cancel-workflow-action.

obrassard avatar obrassard commented on August 14, 2024

Hello @JoseThen and @styfle, I hope you're doing well !
Do you have any update on this issue 😄 ?

from cancel-workflow-action.

JoseThen avatar JoseThen commented on August 14, 2024

Actually no updates from me, I should close this issue, are you needing this specific function for your use case? If so you mind saying what it is?

from cancel-workflow-action.

obrassard avatar obrassard commented on August 14, 2024

Thanks !!

from cancel-workflow-action.

JoseThen avatar JoseThen commented on August 14, 2024

So I did some light testing with main...JoseThen:main . I guess the real question is how far you want to go with this "feature".

Example: https://github.com/JoseThen/cancel-workflow-action/runs/1236893939?check_suite_focus=true check Results step

from cancel-workflow-action.

obrassard avatar obrassard commented on August 14, 2024

@JoseThen Thanks for your feedback. To answer your question, we don't need much details only a way to know if a previous build was cancelled by the action or not. So a success / failure flag is enough for our use case. However, I might be wrong, but it seems that in your branch you set core.setOutput('RESULT', 'failure'); only when there is an error (in the catch block), but we would also need to get the failure (or something else) flag in the case where there is no error, but no previous action was running / cancelled. Don't hesitate, to @ me if something is not clear !😅

from cancel-workflow-action.

styfle avatar styfle commented on August 14, 2024

I read the original description of the issue and I don’t think we can determine “successfully canceling a previous run” easily.

The problem is that the GitHub API response is 202 Accepted meaning that the action finishes before GitHub actually cancels the workflow. See #23 for more info.

from cancel-workflow-action.

obrassard avatar obrassard commented on August 14, 2024

@styfle Thanks, I understand that we cannot know if the cancelling was successful or not. Nonetheless, do we have a way to check if a previous build was running before cancelling it (vs if there was none) ? This is the information I would need 😄

from cancel-workflow-action.

styfle avatar styfle commented on August 14, 2024

Yes that is possible. Basically we could return the status codes from the api as outputs so you get an empty array when nothing was cancelled or an array of 202 if all the ids were cancelled (or perhaps 500 if GH API was down).

We already log this information so it can be turned into Action outputs too.

from cancel-workflow-action.

obrassard avatar obrassard commented on August 14, 2024

@styfle Sounds good for me !

from cancel-workflow-action.

obrassard avatar obrassard commented on August 14, 2024

Hey! Has anyone had a chance to work on this? If not, I may be able to do so soon 😄

from cancel-workflow-action.

styfle avatar styfle commented on August 14, 2024

Closing since there are no upvotes on this issue and no one is working on it

from cancel-workflow-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.