Giter Club home page Giter Club logo

Comments (10)

styfle avatar styfle commented on August 14, 2024 3

We have the Advanced Usage so you would need to pass the names of all the other workflows.

This accepts names or IDs as seen here:

workflow_id: 479426, 830809, sleep120.yml

That being said, we could add a new feature for workflow_id: all or something like that to indicate you want this workflow to cancel all other workflows.

from cancel-workflow-action.

mfn avatar mfn commented on August 14, 2024 2

For the lazy, guess you're talking about this https://github.com/zulip/zulip/blob/143206795949d85545d1a76f634d23b5b780898f/.github/workflows/cancel-previous-runs.yml#L23-L36

      - name: Get workflow IDs.
        id: workflow_ids
        env:
          # This is in <owner>/<repo> format e.g. zulip/zulip
          REPOSITORY: ${{ github.repository }}
        run: |
          workflow_api_url=https://api.github.com/repos/$REPOSITORY/actions/workflows
          curl $workflow_api_url -o workflows.json
          script="const {workflows} = require('./workflows'); \
                  const ids = workflows.map(workflow => workflow.id); \
                  console.log(ids.join(','));"
          ids=$(node -e "$script")
          echo "::set-output name=ids::$ids"

from cancel-workflow-action.

styfle avatar styfle commented on August 14, 2024 2

Feel free to create a PR and I'll take a look πŸ‘

from cancel-workflow-action.

Abhirup-99 avatar Abhirup-99 commented on August 14, 2024 1

I am in favor of the all feature as having 2 workflows for cancelling doesn't feel good.

from cancel-workflow-action.

anshulsahni avatar anshulsahni commented on August 14, 2024 1

@styfle Created a Pull request to close this issue, please review

from cancel-workflow-action.

styfle avatar styfle commented on August 14, 2024

You can use the workflow name instead of the ID as mentioned in the README:

image

from cancel-workflow-action.

mfn avatar mfn commented on August 14, 2024

I'm not sure I ever thought about this or if it's even possible, but a mode where it automatically cancels all workflows except it's would be great. That basically how I use it and once you've a lot of repos with lots of workflows, it gets easy to miss the one or other in a while…

from cancel-workflow-action.

Abhirup-99 avatar Abhirup-99 commented on August 14, 2024

Guys please head over to zulip/zulip to take a look. We are doing some good work :). We already did it, that's why thought of creating this issue over here as a heads up.

from cancel-workflow-action.

pllim avatar pllim commented on August 14, 2024

Are you sure it works? When I look in https://github.com/zulip/zulip/runs/1772509492?check_suite_focus=true , I see Resource not accessible by integration error for pull_request event.

Digging through the logs, it is like this as far back as 2020-12-10 (https://github.com/zulip/zulip/runs/1531990604?check_suite_focus=true).

I am not sure if GitHub changed the scope of github.token or it has always been like this for pull_request.

from cancel-workflow-action.

ismay avatar ismay commented on August 14, 2024

That being said, we could add a new feature for workflow_id: all or something like that to indicate you want this workflow to cancel all other workflows.

Should we create a separate feature request issue for this? Or will it be tracked here? I think it would be great to have this.

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.