Skip to content
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

CI: cancel previous runs for pull requests #6437

Merged
merged 3 commits into from
Oct 10, 2022

Conversation

chenxsan
Copy link
Member

@chenxsan chenxsan commented Oct 9, 2022

No description provided.

@vercel
Copy link

vercel bot commented Oct 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
webpack-js-org ✅ Ready (Inspect) Visit Preview Oct 9, 2022 at 0:36AM (UTC)

@chenxsan chenxsan marked this pull request as ready for review October 9, 2022 12:18
Copy link
Member

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can run on PR event

Comment on lines +2 to +6
on:
workflow_run:
workflows: ["Ensure PR"]
types:
- requested
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
on:
workflow_run:
workflows: ["Ensure PR"]
types:
- requested
on:
pull_request:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, it won't run against those pull requests from forks https://github.com/styfle/cancel-workflow-action#advanced-pull-requests-from-forks. E.g, I'm submitting this pull request from my forked repository.

Copy link
Member

@snitin315 snitin315 Oct 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try this, we have a similar setup in webpack-contrib and it runs on PR from forks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Any reason to avoid workflow_run? Seems fine to me according to the documentation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it running with workflow_run? I don't see it running in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can only test it after getting it merged, not in this one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with it if it works 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll test it once merged.

steps:
- uses: styfle/cancel-workflow-action
with:
workflow_id: ${{ github.event.workflow.id }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
workflow_id: ${{ github.event.workflow.id }}
workflow_id: testing.yml
access_token: ${{ github.token }}

@chenxsan chenxsan merged commit 3dab627 into webpack:master Oct 10, 2022
@chenxsan chenxsan deleted the feature/cancel-previous-workflow branch October 10, 2022 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants